Skip to content
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

Error in Browser for newer version #639

Closed
wreardan opened this issue Feb 8, 2014 · 7 comments · Fixed by creationix/mine#3
Closed

Error in Browser for newer version #639

wreardan opened this issue Feb 8, 2014 · 7 comments · Fixed by creationix/mine#3

Comments

@wreardan
Copy link

wreardan commented Feb 8, 2014

We are using Windows 7 x64 and version 0.10 of node.js

I was using an older version of Browserify (3.20.0) and successfully compiled our project.

However, my teammates installed the newest version (3.24.13) and the project compiles but when we try to run it in a browser we get the following error message:

Error: Cannot find module 'c:\Users\Martin Wickham\AppData\Roaming\npm\node_modules\browserify\node_modules\insert-module-globals\node_modules\process\browser.js'

@sirbob
Copy link

sirbob commented Feb 10, 2014

Hi,
Same here - in our output file, the very last line has a full path to browser.js. this path is incorrectly escaped: '\\' instead of '\'. (Four backslashes instead of two) e.g.:

C:\\Users\\bob\\PROJECTS\\xyz\\abc\\node_modules\\browserify\\node_modules\\insert-module-globals\\node_modules\\process\\browser.js

If I manually remove extra backslashes, then it works OK.

Using version 3.28.0.

Please help. thanks

@DjebbZ
Copy link

DjebbZ commented Feb 11, 2014

Same problem happened to us today, same config (OS, node and browserify versions), same "manual fix" (removing extra backslashes).
-- edit : Browserify is actually in version 3.28.1

@ghost
Copy link

ghost commented Feb 11, 2014

insert-module-globals does this:

var processModulePath = require.resolve('process/browser.js');
        return 'require(' + JSON.stringify(processModulePath) + ')';

@DjebbZ
Copy link

DjebbZ commented Feb 11, 2014

Was it doing this before ? If so, how come it's not working now when it was working before ?
Another solution (well, just a suggestion, I'm new to Browserify) would be to convert the path strings on Windows so they never use backslashes but normal slash. The module id strings would still be unique and browserify could load modules normally in the bundled files. No ?

@ghost
Copy link

ghost commented Feb 13, 2014

I don't have a good way to reproduce this since I'm on a linux laptop, so it's up to somebody on windows to send a patch!

@tec27
Copy link

tec27 commented Feb 13, 2014

Should be fine with the newest version of mine (0.0.2), I think this can be closed.

@ghost
Copy link

ghost commented Feb 13, 2014

Closing since creationix/mine#3 was merged.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants