-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@sveltejs/adapter-node: Unable to find certain packages in built app #2139
Comments
Dependencies aren't bundled into the final build. Did you copy the |
@ignatiusmb I assumed that the build folder was a stand-alone node server and had all the dependencies included in it. Let me try with the full package.json. I was only using a basic one (like below) for deployment.
But, why does the svelte-frappe-charts dependency work fine? |
You should make sure the dependencies in the original package.json exists in the server. svelte-frappe-charts exposes a |
Ah understood. But for packages that expose a
So, if I am using AWS EB to deploy the build app, how do I do it? Do I have to install the dependencies in the package.json within the build folder? And then push the folder to AWS? Or is there a better approach? |
You're free to do it however you like, I suggest you seek help on either the Discord or Stack Overflow. From the relevant PR #1648
It seems this hasn't been properly documented in the package readme, which is pretty important as we had similar issues with deploying Sapper app back then. Marking as a documentation issue instead. |
Describe the bug
Certain packages don't seem to get exported into the build when using the node adapter.
npm run preview
for the built app works fine, but if the build folder is run as a stand-alone node server using a barebones package.json and with the commandnode index.js
, the following error appears for some packages:This doesn't happen for all packages though. In my demo app, there are three packages in production dependencies. While svelte-frappe-charts, dotenv work fine, pg and pg-promise don't.
Due to this, deployment to an environment like AWS fails, with the same
Error [ERR_MODULE_NOT_FOUND]
error. Is this an issue with adapter-node related to the packages?Reproduction
I've created a demo repo here - https://github.com/sridharraman/sveltekit-api-chart
If you want to test the api endpoint, you can run the following SQL statements in your database:
In the dev environment, these are the links that work fine:
localhost:3000/api/orders
localhost:3000/chart
They show that the database and chart packages work fine.
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: