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

4.2.0 breaks pre-14.x code #775

Open
Cireo opened this issue Apr 9, 2021 · 5 comments
Open

4.2.0 breaks pre-14.x code #775

Cireo opened this issue Apr 9, 2021 · 5 comments

Comments

@Cireo
Copy link

Cireo commented Apr 9, 2021

Might want to mention this in a release note. Had a nested dependency require "mustache": "^4.0.1" which broke something running on earlier npm when 4.1.0 went to 4.2.0

Error: No valid exports main found for '.../node_modules/mustache'
@phillipj
Copy link
Collaborator

phillipj commented Apr 9, 2021

Hi @Cireo,

and thanks for reporting! 👍🏻

This is really something I'd like to get to the bottom of. The changes published in v4.2.0 was not meant to break already using projects, but rather allow more project using mustache. There is always a chance we did not consider certain usage scenarios.

Before we either update the release notes with migration notes or publish a new version fixing the issue, it's crucial for us to know what exploded on your end.

Would you mind sharing any details about your projects? Interesting aspects I can think of;

  1. versions of Node.js/npm
  2. Is there a build tool like webpack/rollup/etc involved?
  3. Are you using ES Modules w/import-syntax or good old CommonJS w/require()?

@phillipj
Copy link
Collaborator

Have not been able to reproduce this kind of error you've reported yet.. Also verified in CI: #779.

Still very curious how your project is glued together, so please let us know if you've got a spare moment anytime soon.

@Cireo
Copy link
Author

Cireo commented Apr 21, 2021

I've tried to reproduce in smaller environments, but wasn't able to. Some extra context

  • The breaking version of Node was 12.x (upgrading to 14.x fixed the behavior)
  • Webpack had succeeded at build time (these were actually old versions of code that had been working in the past), but was not used in these particular environments, they built themselves from package.json requirements
  • The dependency chain was email-templates -> i18n -> mustache
  • npm was used, (pnpm shouldn't have been invoked, but was eventually present on the system)
  • Happened across multiple machines

I appreciate you looking into the issue, and will update if I can find a root cause.

@jwalton
Copy link

jwalton commented May 14, 2021

I'm running into a perhaps related problem from eslint-plugin-import:

/Users/jwalton/project/src/components/root/routes/components/events/renderers/base.react.js
  2:22  error  Unable to resolve path to module 'mustache'  import/no-unresolved

/Users/jwalton/project/src/components/root/routes/components/events/renderers/transaction.react.js
  2:22  error  Unable to resolve path to module 'mustache'  import/no-unresolved

/Users/jwalton/project/src/components/root/routes/components/events/renderers/videoLinkItems.react.js
  3:22  error  Unable to resolve path to module 'mustache'  import/no-unresolved

@jwalton
Copy link

jwalton commented May 14, 2021

Ahh, my import error is probably related to import-js/eslint-plugin-import#1868.

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

No branches or pull requests

4 participants
@phillipj @jwalton @Cireo and others