I have difficulty running my SvelteKit app from a 'build' folder.
When I type npm run build in VS Code, it creates the 'build' output folder. Then when I navigate to the build folder (cd build) and run the app from there (node index.js) the app works.
But if I copy the build folder out of the project's root folder and save it on the desktop, it doesn't work when I run the node index.js command.
Error:
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Isn't a build folder self-contained? Why doesn't it work outside of the project folder?