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

Import path on windows #108

Closed
Achaak opened this issue Oct 18, 2021 · 3 comments
Closed

Import path on windows #108

Achaak opened this issue Oct 18, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Achaak
Copy link
Contributor

Achaak commented Oct 18, 2021

Describe the bug

Hi,

I have a bug.
typesafe-i18n cannot find a path .

Thanks

Reproduction

I just follow the readme and test on a windows device in a library using webpack.
But I just run the script: "typesafe-i18n": "typesafe-i18n",

Logs

npm run typesafe-i18n

> typesafe-i18n_react-demo@1.0.0 typesafe-i18n
> typesafe-i18n

[typesafe-i18n] generating files for TypeScript version: '4.4.x'
1\en\index.js Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
[typesafe-i18n] ERROR: could not read default export from language file 'en'[typesafe-i18n] generated file: i18n-types.ts[typesafe-i18n] ... all files are up to date
[typesafe-i18n] files were modified => looking for changes ...
[typesafe-i18n] ERROR: import failed for C:\PATH\node_modules\typesafe-i18n\temp-output\12\en\index.js Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
[typesafe-i18n] ERROR: could not read default export from language file 'en'[typesafe-i18n] ... all files are up to date

Config

{
  "$schema": "https://unpkg.com/typesafe-i18n@2.45.0/schema/typesafe-i18n.json",

  "baseLocale": "en",
  "adapter": "react",
  "loadLocalesAsync": true
}

Additional information

No response

@Achaak Achaak added the bug Something isn't working label Oct 18, 2021
@ivanhofer
Copy link
Owner

Do you have "context" : "module"written in your package.json file?
I will try to reproduce the issue tomorrow

@ivanhofer
Copy link
Owner

fixed in version 2.46.1

@Achaak
Copy link
Contributor Author

Achaak commented Oct 19, 2021

It's ok
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants