Skip to content

Added module to ignored node modules list#5798

Merged
mrmckeb merged 1 commit into
react:masterfrom
dotansimha:master
Jan 16, 2019
Merged

Added module to ignored node modules list#5798
mrmckeb merged 1 commit into
react:masterfrom
dotansimha:master

Conversation

@dotansimha

@dotansimha dotansimha commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

Some dependencies (or dependencies of dependencies) might try to load module module, and it breaks CRA apps (such as https://github.com/sindresorhus/resolve-from) because Webpack can't find this module.

This PR adds module to list of empty node modules.

@Timer

Timer commented Nov 14, 2018

Copy link
Copy Markdown
Contributor

How is resolve-from used in the Browser? Can you provide a more concrete example please?

@dotansimha

Copy link
Copy Markdown
Contributor Author

@Timer , it's not actually, it's a dependency of dependency.
For example, graphql-import package can be loaded on client side, which loads import-from, which loads resolve-from, and the module is loaded.

@jberney

jberney commented Dec 8, 2018

Copy link
Copy Markdown

Another library using module is source-map-support. My CRA project is using source-map-support because:

info Reasons this module exists
   - Hoisted from "react-scripts#terser-webpack-plugin#terser#source-map-support"
   - Hoisted from "react-scripts#jest#jest-cli#jest-runner#source-map-support"
...
=> Found "babel-register#source-map-support@0.4.18"
info This module exists because "babel-core#babel-register" depends on it.

It looks like source-map-support put the attempt to load module in a try/catch, so it doesn't break my CRA app. But it does cause a console warning both on load and after every hot reload, which can be sort of noisy.

@stale

stale Bot commented Jan 12, 2019

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale Bot added the stale label Jan 12, 2019
@dotansimha

Copy link
Copy Markdown
Contributor Author

@Timer ? someone?

@stale stale Bot removed the stale label Jan 13, 2019
@mrmckeb

mrmckeb commented Jan 13, 2019

Copy link
Copy Markdown
Contributor

@dotansimha The CI issues should be resolved now, can you please rebase? Then I can merge this in. Thanks!

@dotansimha

Copy link
Copy Markdown
Contributor Author

@mrmckeb done :)

@mrmckeb mrmckeb merged commit 34e5029 into react:master Jan 16, 2019
@mrmckeb

mrmckeb commented Jan 16, 2019

Copy link
Copy Markdown
Contributor

OK, I've merged this in. It's very low risk, but I'll keep a lookout for any potentially related new issues.

@Timer Timer added this to the 2.1.4 milestone Jan 16, 2019
@lock lock Bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants