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

If a package is missing, warn which file imported it. #1463

Closed
justinbmeyer opened this issue Sep 18, 2018 · 4 comments
Closed

If a package is missing, warn which file imported it. #1463

justinbmeyer opened this issue Sep 18, 2018 · 4 comments

Comments

@justinbmeyer
Copy link
Contributor

image

The above warning should be visible by using this commit: canjs/can-stache-route-helpers@5085b65

of can-stache-route-helpers

@justinbmeyer
Copy link
Contributor Author

To make this warn now, you'll probably manually have to delete can-define from your node_modules folder as the bug in can-define is fixed. The warning might be because the module importing can-define was within node_modules.

@leoj3n
Copy link
Contributor

leoj3n commented Nov 20, 2018

I have the same issue with the events package. I can't figure out who is trying to use events when it 404s. All I know is that it 404'd. Even if I manually bundle events:

    "map": {
      "events": "~/node_modules/events/events"
    },
    "bundle": [
      "~/node_modules/events/events",

Which causes dist/bundles/my-project/node_modules/events/events.js to exist, it still 404s because it is looking for /dist/node_modules/events/events.js which is outside the my-project bundle which is probably related to what @justinbmeyer mentioned:

The warning might be because the module importing can-define was within node_modules.

Is there some way to create a mapping to fix this? Currently the only solution I have is to manually create the /dist/node_modules/events/ directory and copy events.js as part of the build step.

@cherifGsoul
Copy link
Contributor

cherifGsoul commented Jan 10, 2019

My solution to solve this issue is to add stack property to

newError.statusCode = error.statusCode;

newError.stack = error.stack

screen shot 2019-01-10 at 11 59 24 pm

@cherifGsoul
Copy link
Contributor

After discussion with @matthewp the error will look like the following screenshot:

screen shot 2019-01-11 at 8 48 04 pm

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

No branches or pull requests

4 participants