-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Cannot find module 'dayjs/plugin/timezone' in sub-module #1167
Comments
A reproduction repo, please? |
This was resolved when I added |
Can you explain what you mean? Added where in the app? |
That's a good question 🤔 |
I dont know if its in codesanbox that's making the error,, but here is the example of an error,,, cant find module. |
I had a similar problem when compiling a production build of a SvelteKit app. The solution, as console error has suggested, was to add the Example: |
but why? |
Using PNPM a related error appeared as:
Adding |
More about what's causing this error with bare imports: https://nodejs.org/api/esm.html#esm_mandatory_file_extensions |
If you are using playwright, It has to do with module resolution, typescript and js, don't remember where I read it but I know is close enough to that situation. I someone can add a more extensive description would be great. |
Describe the bug
Similar to #1135, getting
Cannot find module 'dayjs/plugin/timezone' from 'node_modules/my-module'
when importing my module from elsewhere and trying to run tests.The plugin works properly within the code where it's used, but this issue appears when importing it as node_module.
Expected behavior
Able to import dayjs plugins and use them in code used as a sub-module.
Usage in sub-module:
Information
The text was updated successfully, but these errors were encountered: