-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
on latest adapter-node Could not dynamically require "x". Please configure the dynamicRequireTargets
#7266
Comments
I doubt we'd want to expose all of the Rollup plugin configuration in the Node adapter configuration. If shelljs is doing something weird with dynamic requires, I'd suggest moving it from a dev dependency to a prod dependency so that Rollup doesn't try to bundle it. |
It already is in prod dependancies, tried in dev dependancies and with NODE_ENV production and development but same result. Essentially what it does, it tried to require something like commands.forEach(function (command) {
commonjsRequire('./src/' + command);
}); Which does not exist after build-node But on a previous adpater version file was just resolving to the same file without trying to do all this weird imports. And now I get what did you mean - it bundles it into the file. But how to prevent it ? |
I will close that then and monitor #7216 |
Describe the bug
Another issue after migrating to latest sveltekit and adapter-node.
one of my routes, has a server route that uses shelljs it worked fine before. But now: on dev it works, but after building with adapter-node, and running server - upon navigating to that route, I get that error Error: Could not dynamically require "./src/cat". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work. Any ideas ?
Also not sure if it's related but on build with adapter node I get information about
Circular dependency: ../../node_modules/.pnpm/[email protected]/node_modules/shelljs/shell.js -> ../../node_modules/.pnpm/[email protected]/node_modules/shelljs/src/common.js -> ../../node_modules/.pnpm/[email protected]/node_modules/shelljs/shell.js
Reproduction
Use
shelljs
module in one of the js files that route depends on.Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: