-
Notifications
You must be signed in to change notification settings - Fork 10.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
bundle failed trying to import fully specified paths #31077
Comments
Hi @Josehower! Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it. We have tried the example above and we couldn't see the above error. If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look. Thanks for using Gatsby! 💜 |
@wardpeet in trying to help José a bit just now, I thought it was maybe related to your PR over here: #29576 (comment) |
I guess there may still be an issue with TypeScript (user-created .tsx and .ts files that use imports with |
🤔 maybe. Packages should not export ts or tsx files. I would love some kind of reproduction :) |
Yep, José is working on one now, should be here soon :) |
https://codesandbox.io/s/serene-leaf-2vivd?file=/src/components/layout.tsx here you have the link for an Out of the box gatsby sandbox with minimal changes
Note: make sure you go to the browser port: 8000 tab |
To be clear what we're trying to do:
With regular TypeScript, this works, and is recommended: microsoft/TypeScript#41887 (comment)
With Gatsby TypeScript, it doesn't work. Edit: Upon further reflection, this seems like a bug in webpack's module resolution algorithm (or in @Josehower will create issues over there. Edit 2: Issue for webpack open: webpack/webpack#13252 |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Description
When using fully specified paths in imports
e.g
export { quiz as jsFunctions } from './js-functions.js';
gatsby send this error message
Steps to reproduce
type: module
to package.jsonExpected result
Gatsby should allow imports with .js extention
Actual result
Gatsby fail trying to generate JavaScript bundle
Environment
Run
gatsby info --clipboard
in your project directory and paste the output here.$ yarn gatsby info --clipboard
yarn run v1.22.5
$ D:\upleveled-softwork\courses\node_modules.bin\gatsby info --clipboard
System:
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
Binaries:
Node: 16.0.0 - ~\AppData\Local\Temp\yarn--1619542324765-0.4257021548777624\node.CMD
Yarn: 1.22.5 - ~\AppData\Local\Temp\yarn--1619542324765-0.4257021548777624\yarn.CMD
npm: 7.10.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 90.0.4430.93
Edge: Spartan (44.19041.906.0), Chromium (90.0.818.46)
✨ Done in 4.44s.
The text was updated successfully, but these errors were encountered: