-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
New package exports error with v4.0.0 #291
Comments
Any chance you can put together a minimal, reproduceable test case? I'd like to avoid defining multiple paths for a single resource in |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@brev Can you file an issue with Vite/Svelte to get their take on this? My understanding is that the current setup is consistent with how |
This comment was marked as off-topic.
This comment was marked as off-topic.
Add workaround for broofa/mime#291 Signed-off-by: Martin Dünkelmann <[email protected]>
Add workaround for broofa/mime#291 Signed-off-by: Martin Dünkelmann <[email protected]>
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @broofa, thanks for the help, sorry for the slow response. Let me dig in a bit and see what I can find, I'll either post back here, or close this and open an issue elsewhere in the appropriate place. thanks. |
Ok, the problem shows up when my current project uses The problem is solved when making sure that my project, and all dependencies, are all upgraded to thanks. |
@broofa I still get the error const { Mime } = await import('mime');
const { default: standardTypes } = await import('mime/dist/types/standard.js');
const mime = new Mime(standardTypes);
mime.define({
'application/vnd.oasis.opendocument.presentation': ['odp'],
'application/vnd.oasis.opendocument.spreadsheet': ['ods'],
'application/vnd.oasis.opendocument.text': ['odt'],
'application/vnd.openxmlformats-officedocument.presentationml.presentation': ['pptx'],
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['xlsx'],
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['docx'],
}); Using the path without dist instead is not working either. The only way I can get this to work, is when I alter your package.json exports to include the dist path as well:
Is it possible to export at least both paths? The "old" one and the actual "new" one? |
@7freaks-otte 'mime/dist/types/standard.js' is not exposed by Using the [documented] Maybe put together an MRE that demonstrates the problem and share that here? Not much I can do without being able to reproduce the issue.
|
Thanks for your feedback @broofa I understand that But this results in the TypeScript error Your hint regarding the build toolchain seems right but is unfortunately beyond my control. I'm including your module in an Angular app and their toolchain This seems to be the source of the problem. Not that a submodule includes an old version of From my findings express v5 no longer includes mime, at least not the types, so I need to wait for |
@7freaks-otte This is why it's really helpful to provide an MRE. This is a different (and possibly valid?) issue that I'd like to understand further. But until I can reproduce it my hands are tied. For example, here's a stackblitz I created to try to reproduce the issue, but I was only able to trigger a similar-but-not-identical error related to how the So, I have two "asks":
[Edit: Actually, please create a new issue with the requested information, as this is different from the original issue above] |
@broofa Thanks for digging into this. I was just about to tell you that I'm going to try to create an MRE as soon as I meet the deadline of an important project. But I actually think that I just found the solution (though not the exact explanation why the error occurred): Your stackblitz pretty much matches my configuration except for one entry: Angular projects typically have As soon as I change Side note: |
@broofa thank you so much for the care you put on this, I read your explanation, but there is something I miss in it. |
Hi,
Upon upgrading to
v4.0.0
, I started getting new errors when building my SvelteKit / Vite / TypeScript project:I think somewhere during transpilation (out of my control), my
import mime from 'mime/lite'
is getting turned intoimport mime from 'mime/lite.js'
, which isn't covered by the currentexports
inpackage.json
.I'll submit a quick fix PR very soon.
Thanks for the great module.
The text was updated successfully, but these errors were encountered: