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: Cannot find module" output should include filename #60

Closed
jmm opened this issue Dec 3, 2014 · 8 comments · Fixed by #162
Closed

"Error: Cannot find module" output should include filename #60

jmm opened this issue Dec 3, 2014 · 8 comments · Fixed by #162

Comments

@jmm
Copy link
Contributor

jmm commented Dec 3, 2014

When using browserify and there's a problem with the path to a module, I get error output like:

Error: Cannot find module 'module' from '/dir/subdir'

There may be any number of files in subdir that were trying to require the module. It would be really helpful for the error output to include the filename that contained the require() call instead of just the path to the dir it resides in.

@spudly
Copy link

spudly commented Dec 9, 2014

+1

@jmm
Copy link
Contributor Author

jmm commented Jan 20, 2015

This can be fixed if browser-resolve will pass through the original options it's called with. See browserify/browser-resolve/pull/52. If you'd like to see this fixed please voice your support there.

@jmm
Copy link
Contributor Author

jmm commented Jan 20, 2015

@defunctzombie merged browserify/browser-resolve/pull/52 to pass through the options, so I'll be working on a PR here for this.

@obuchtala
Copy link

We would also love to see this fixed. What is the state of #64. Will it be merged eventually?

@jmm
Copy link
Contributor Author

jmm commented Feb 5, 2016

Made a plugin for this: https://www.npmjs.com/package/browserify-require-not-found-parent

@ljharb
Copy link
Member

ljharb commented Dec 17, 2016

This will be taken care of once #64 (comment) is rebased.

@A-312
Copy link

A-312 commented May 20, 2020

#162 is not merged on browsersify

Also 4 years after, this solution steals works fine:

Made a plugin for this: https://www.npmjs.com/package/browserify-require-not-found-parent

@ljharb
Copy link
Member

ljharb commented May 20, 2020

@A-312 that PR is merged on this repo, and released in v1.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment