weird situations and errors with nginx / pm2 #9209
-
I am not much familiar much with sveltekit ,nodejs nor pm2. But I think I have very weird situation. If my app run on local or remote server ip, it works good. But if it runs with domain name with https( https://mydomain.com/ ), these errors come out often, NOT every time. /_app/immutable/chunks/2.911bf9f6.mjs net::ERR_ABORTED 503
/_app/immutable/entry/_error.svelte.4387a6bd.mjs net::ERR_ABORTED 429 app.a98782ed.mjs:1 TypeError: Failed to fetch dynamically imported module:
_app/immutable/chunks/1.1a0675af.mjs net::ERR_ABORTED 429
start.4d6997de.mjs:3 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: /immutable/chunks/1.1a0675af.mjs
/:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: /_app/immutable/chunks/1.1a0675af.mjs I run my app with // svelte.config.js
import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter()
}
};
export default config; // ecosystem.config.cjs
module.exports = {
apps: [
{
name: 'my-stream-app',
script: 'build/index.js',
instances: 6,
exec_mode: 'cluster',
env: {
PORT: 3001,
NODE_ENV: "development"
}
}
]
};
I run my app as like this. npm run build
pm2 restart ecosystem.config.cjs --env env --node-args='--max-old-space-size=1024' The error occurs in case of And It works ok once in a while with https://real-domain-name.com . Real server IP access ( http://123.123.123.123 ) does not show errors. Can somebody give me tips to fix ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Now I am guessing that it is because of connection limit in nginx. in my nginx.conf I had this line
So it blocked multiple links. I dont know how to set up this. But when it fiexed I think it is because of the connection limit. Anybody, who has trouble with Anybody who has problem with think if this is the reason. Thanks guys for corcerns. |
Beta Was this translation helpful? Give feedback.
Now I am guessing that it is because of connection limit in nginx.
in my nginx.conf
I had this line
So it blocked multiple links.
I dont know how to set up this.
But when it fiexed
limit_conn perip 20;
, no errors came out.I think it is because of the connection limit.
Anybody, who has trouble with Anybody who has problem with
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module:
,think if this is the reason.
Thanks guys for corcerns.