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

Check dot imports vs node_modules #7948

Closed
richtera opened this issue Nov 12, 2020 · 3 comments · Fixed by #7950
Closed

Check dot imports vs node_modules #7948

richtera opened this issue Nov 12, 2020 · 3 comments · Fixed by #7950
Assignees
Milestone

Comments

@richtera
Copy link
Contributor

What version of Hugo are you using (hugo version)?

Hugo Static Site Generator v0.78.1/extended darwin/amd64 BuildDate: unknown

Does this issue reproduce with the latest release?

I am compiling some js code with "js.Build"
I have a file called "util.js" which I import using import { method } from "./util" and then I am also import the npm module "url" from "npm install url" using import { parse } from "url". Inside of the url module there is also an import from "./util" and it's getting resolved to my util.js module and causing crashes. This seems to indicated it's resolving modules by names and not resolved paths.

@richtera
Copy link
Contributor Author

The code works if I rename my local file "utilities", so I think that seems to validate the name import.

@bep
Copy link
Member

bep commented Nov 12, 2020

OK, it looks like it's some odd going on with the . imports that needs a fix. Thanks for the report.

@bep bep changed the title In the latest version something weird is going on with js.Build resolve Check dot imports vs node_modules Nov 12, 2020
@bep bep self-assigned this Nov 12, 2020
@bep bep added the Bug label Nov 12, 2020
@bep bep added this to the v0.78.2 milestone Nov 12, 2020
bep added a commit to bep/hugo that referenced this issue Nov 12, 2020
This commit fixes some issues where modules in /assets share the same name as in node_modules.

This was not intended, and with this commit the node_modules-components should be isolated. If you want to redefine something inside node_modules, use the `defines` option.

Fixes gohugoio#7948
bep added a commit to bep/hugo that referenced this issue Nov 12, 2020
This commit fixes some issues where modules in /assets share the same name as in node_modules.

This was not intended, and with this commit the node_modules-components should be isolated. If you want to redefine something inside node_modules, use the `defines` option.

Fixes gohugoio#7948
bep added a commit to bep/hugo that referenced this issue Nov 12, 2020
This commit fixes some issues where modules in /assets share the same name as in node_modules.

This was not intended, and with this commit the node_modules-components should be isolated. If you want to redefine something inside node_modules, use the `defines` option.

Fixes gohugoio#7948
@bep bep closed this as completed in #7950 Nov 13, 2020
bep added a commit that referenced this issue Nov 13, 2020
This commit fixes some issues where modules in /assets share the same name as in node_modules.

This was not intended, and with this commit the node_modules-components should be isolated. If you want to redefine something inside node_modules, use the `defines` option.

Fixes #7948
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants