Error on package that is NPM linked #2831
jasonericdavis
started this conversation in
General
Replies: 2 comments
-
I confirm the bug and the workaround ;-) I also confirm that the same package not symlinked is working. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm facing the same issue right now |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
While trying to use a package that is npm linked an error is thrown within the server-bare-modules plugin.
Steps to reproduce:
npm init
command. Start the package name with the@
characer.npm link
command create a local global package.npm link <name of package from step 2>
to link the two projects.Expected Outcome:
Actual Outcome:
Notes
The npm link command creates a symlink to the local package which cause the function resolveModuleBasePath(packageName: string, fullImportPath: string) in the serverBareModules plugin to pull the full path of the imported package instead of the path to the node_modules folder when it doing the
require.resolve()
This error won't occur if the name of the package is the same as the linked folder.
Work Around
The current work around is to update the import to pull from the node_modules folder as a relative path.
remix/packages/remix-dev/compiler/plugins/serverBareModulesPlugin.ts
Line 174 in a2e1449
Beta Was this translation helpful? Give feedback.
All reactions