You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change introduced in #3085, where dependencies are tested with require.resolve, fails for modules that do not export a default main. For instance, my Remix app imports @noble/hashes/blake3 - the serverBareModulesPlugin will attempt to require.resolve('@noble/hashes'), which fails because @noble/hashes does not have a main export (intentionally so).
Attempt to import @noble/hahes/blake3 in a file (or any other module that requires importing from a subpath export and does not have a main export)
Expected Behavior
I would expect that the detection logic is able to determine that @noble/hashes is included in my package.json
Actual Behavior
Currently it assumes that any failure of require.resolve implies that the module is not listed in package.json (source) and displays the following warning:
The path "@noble/hashes/blake3" is imported in app/utils/filename.server.ts but @noble/hashes is not listed in your package.json dependencies. Did you forget to install it?
The text was updated successfully, but these errors were encountered:
The path "@heroicons/react/solid" is imported in src/app/routes/login.tsx but @heroicons/react is not listed in your package.json dependencies. Did you forget to install it?
We just published version v0.0.0-nightly-de9fc05-20220712 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!
What version of Remix are you using?
1.6.2
Steps to Reproduce
The change introduced in #3085, where dependencies are tested with
require.resolve
, fails for modules that do not export a defaultmain
. For instance, my Remix app imports@noble/hashes/blake3
- the serverBareModulesPlugin will attempt torequire.resolve('@noble/hashes')
, which fails because@noble/hashes
does not have a main export (intentionally so).@noble/hahes/blake3
in a file (or any other module that requires importing from a subpath export and does not have a main export)Expected Behavior
I would expect that the detection logic is able to determine that
@noble/hashes
is included in mypackage.json
Actual Behavior
Currently it assumes that any failure of
require.resolve
implies that the module is not listed inpackage.json
(source) and displays the following warning:The text was updated successfully, but these errors were encountered: