-
Notifications
You must be signed in to change notification settings - Fork 1.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
Expose property doesn't work when requiring a module name #850
Comments
I have this issue trying to use the command line with browserify-fs. Browserify 3.46.1 works but it seems that anything above 4.0.0 fails. |
+1 Only fails when using a module name. |
+1 |
+1 browserify 6.x breaking using the CLI -r option with export alias |
Issue also exists when not using the cli. Personally spotted at 6.1.0. The
This line on its own with no other source files bundled is sufficient to trigger "cannot find module configuration from [absolute directory path]" |
Adding more info, this problem only occurs when using the --full-paths option. Here's the gist: https://gist.github.com/programmarchy/1655e571b6bb36f17c02 (I'm using browserify 6.2.0) |
Did a little spelunking, and found a clue in index.js:297
From deps-sort:
The whole point of using |
Pinging @shenanigans @gobwas @iamrandys @bmpvieira @nathanbowser @tleunen Is the error you are getting: "Uncaught Error: Cannot find module [path to your module]" ? Just want to make sure we are all discussing the same issue. |
Roger. Currently depending |
After more investigation, I think this is related to browser-pack step of browserify. When I bundle without --full-paths, the packing in my gist above looks like this:
With --full-paths, it looks like this
I think that it should instead look like this:
In fact, when I manually patch my bundle, it works. Still looking into why. |
With the example from my first post, here is what I get, with the version 6.2.0
|
@programmarchy Yea, if I run something like this:
It will spit out
That's using browserify 6.2.0 |
And it doesn't look like the usage of |
Sorry for the comment spam, but I should also mention I'm still using [email protected] because the 5.x and 6.x versions have this problem. |
@nathanbowser, try aliasing in package.json. Works for me with browserify 6.2.0
|
#991 fixes the combination of fullPaths and expose for me, if anyone else wants to see if that works for them. |
I was having the same issue and #991 fixed it for me as well. |
Same issue too, #991 fixed it too |
I ran into the same blocking issue too. #991 fixes it too! |
👍 |
2 similar comments
👍 |
👍 |
Not because they should be there, but to work around browserify/browserify#850
With the example, I still get the same error as before, with latest version. Is it something browserify won't support anymore? @substack
|
@tleunen I still have the problem too. The build fail only when using an alias/expose name, even with 6.3.3 |
I also have this problem both in cli and in code using > browserify -r backbone:bb -o test.js Error: Cannot find module 'bb' from 'd:\project' @substack should we open another issue ? Update: > browserify -r ./node_modules/backbone:bb -o test.js |
+1 Using module name instead of module path is still broken in 9.0.3 |
+1 Same here, import by name doesn't work with expose feature. |
Published @ElNounch's fix in 9.0.8. |
With the latest version (5.9.1), aliasing a module name doesn't work anymore.
browserify -r fs:browserify-fs
doesn't create the alias.With an older version (4.2.3), an alias was created with the same command.
No issue with specifying a file instead of a module name.
The text was updated successfully, but these errors were encountered: