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

Not able to compile langneg #579

Closed
mariusrak opened this issue Nov 19, 2021 · 3 comments · Fixed by #581
Closed

Not able to compile langneg #579

mariusrak opened this issue Nov 19, 2021 · 3 comments · Fixed by #581

Comments

@mariusrak
Copy link

As I'm trying to compile langneg 0.6.0 with webpack 5.64.1 I'm getting this errors:

  ERROR in ./node_modules/@fluent/langneg/esm/index.js 9:0-59
  Module not found: Error: Can't resolve './negotiate_languages' in '...\node_modules\@fluent\langneg\esm'
  Did you mean 'negotiate_languages.js'?
  BREAKING CHANGE: The request './negotiate_languages' failed to resolve only because it was resolved as fully specified
  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
  The extension in the request is mandatory for it to be fully specified.
  Add the extension to the request.
   @ ./Application/IntlModule.js 8:0-53
   @ ./ndex.js 25:16-59 26:7-42

  ERROR in ./node_modules/@fluent/langneg/esm/index.js 10:0-57
  Module not found: Error: Can't resolve './accepted_languages' in '...\node_modules\@fluent\langneg\esm'
  Did you mean 'accepted_languages.js'?
  BREAKING CHANGE: The request './accepted_languages' failed to resolve only because it was resolved as fully specified
  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
  The extension in the request is mandatory for it to be fully specified.
  Add the extension to the request.
   @ ./Application/IntlModule.js 8:0-53
   @ ./index.js 25:16-59 26:7-42

  ERROR in ./node_modules/@fluent/langneg/esm/index.js 11:0-42
  Module not found: Error: Can't resolve './matches' in '...\node_modules\@fluent\langneg\esm'
  Did you mean 'matches.js'?
  BREAKING CHANGE: The request './matches' failed to resolve only because it was resolved as fully specified
  (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
  The extension in the request is mandatory for it to be fully specified.
  Add the extension to the request.
   @ ./Application/IntlModule.js 8:0-53
   @ ./index.js 25:16-59 26:7-42

I tried to downgrade to 0.5.2 but I'm getting different error there, so it's not worth it.

@LadyAelita
Copy link

LadyAelita commented Dec 10, 2021

Same deal with @fluent/react@0.14.0 and webpack@5.65.0:

ERROR in ./node_modules/@fluent/react/esm/index.js 19:0-51
Module not found: Error: Can't resolve './localization' in '/<redacted>/node_modules/@fluent/react/esm'
Did you mean 'localization.js'?
BREAKING CHANGE: The request './localization' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./src/client/index.tsx 27:16-40

ERROR in ./node_modules/@fluent/react/esm/index.js 20:0-50
Module not found: Error: Can't resolve './provider' in '/<redacted>/node_modules/@fluent/react/esm'
Did you mean 'provider.js'?
BREAKING CHANGE: The request './provider' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./src/client/index.tsx 27:16-40

ERROR in ./node_modules/@fluent/react/esm/index.js 21:0-55
Module not found: Error: Can't resolve './with_localization' in '/<redacted>/node_modules/@fluent/react/esm'
Did you mean 'with_localization.js'?
BREAKING CHANGE: The request './with_localization' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./src/client/index.tsx 27:16-40

ERROR in ./node_modules/@fluent/react/esm/index.js 22:0-40
Module not found: Error: Can't resolve './localized' in '/<redacted>/node_modules/@fluent/react/esm'
Did you mean 'localized.js'?
BREAKING CHANGE: The request './localized' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./src/client/index.tsx 27:16-40

ERROR in ./node_modules/@fluent/react/esm/index.js 23:0-53
Module not found: Error: Can't resolve './use_localization' in '/<redacted>/node_modules/@fluent/react/esm'
Did you mean 'use_localization.js'?
BREAKING CHANGE: The request './use_localization' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./src/client/index.tsx 27:16-40

It seems that, for some reason, @fluent/react/esm/index.js has no extensions at the end of imports. That was also the case when I installed @fluent/react onto an empty npm package:

export { ReactLocalization } from "./localization";
export { LocalizationProvider } from "./provider";
export { withLocalization } from "./with_localization";
export { Localized } from "./localized";
export { useLocalization } from "./use_localization";

Weirdly enough, locally building the entire projectfluent repo yielded a @fluent/react/esm/index.js with correct imports:

export { ReactLocalization } from "./localization.js";
export { LocalizationProvider } from "./provider.js";
export { withLocalization } from "./with_localization.js";
export { Localized } from "./localized.js";
export { useLocalization } from "./use_localization.js";

I'm using Node 12.22.6 and npm 7.24.2 on Kubuntu 20.04.

@eemeli
Copy link
Member

eemeli commented Dec 21, 2021

Please try again with the just-released @fluent/langneg and @fluent/react? This issue should be fixed in those.

@LadyAelita
Copy link

@eemeli Worked for me, thank you!

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

Successfully merging a pull request may close this issue.

3 participants