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

Wrong mime type for fsevents.node #414

Open
Drarig29 opened this issue Aug 12, 2022 · 7 comments · May be fixed by #415
Open

Wrong mime type for fsevents.node #414

Drarig29 opened this issue Aug 12, 2022 · 7 comments · May be fixed by #415

Comments

@Drarig29
Copy link

My node_modules contain the fsevents package, which depends on the host architecture.

The generated [Content-Types].xml file (extracted from the VSIX extension) contains the following:

<Override ContentType="text/plain" PartName="/datadog-ci/node_modules/fsevents/LICENSE"/>
<Override ContentType="arm64):&#x9;application/x-mach-binary" PartName="/datadog-ci/node_modules/fsevents/fsevents.node"/>

You can see the mime type is wrong here, and because of this it's impossible to upload the VSIX file.
I get the following error when trying to upload:

A token is not valid. Refer to RFC 2616 for correct grammar of content types

Here is the output of the file --mime-type command:

datadog-ci/node_modules/fsevents/fsevents.node: application/x-mach-binary
datadog-ci/node_modules/fsevents/fsevents.node (for architecture x86_64):       application/x-mach-binary
datadog-ci/node_modules/fsevents/fsevents.node (for architecture arm64):        application/x-mach-binary

Temporary workaround

# Only extract the problematic file, and fix it with `sed`.
unzip -p $EXTENSION_FILENAME '\[Content_Types\].xml' | sed 's/arm64):&#x9;//' > '[Content_Types].xml'

# Update the problematic file with the fixed one.
zip $EXTENSION_FILENAME '[Content_Types].xml'
@kirill-ivlev
Copy link
Contributor

Hi @Drarig29!
Thanks for your request, we've added this feature request to our backlog. We'll take a look at it once we have enough capacity.

@aalukacsko
Copy link

I get this issue using npm 6 (6.14.17). I do not see this issue with npm 7 (7.24.2) or npm 8 (8.19.2). This is all using node 14.20.0 on Mac OSX 12.5.1.

@Drarig29
Copy link
Author

I get this issue using npm 6 (6.14.17). I do not see this issue with npm 7 (7.24.2) or npm 8 (8.19.2). This is all using node 14.20.0 on Mac OSX 12.5.1.

For me, it turned out the fsevents package (responsible for this error) was a dependency of one of our devDependencies. Usually this package is used by development tools to watch files for changes in MacOS.

So I'm now installing in production mode ([npm|yarn] install --production).

@Ethan-Arrowood
Copy link

Hey y'all this is still an issue. My build tool for the project is causing the same mime type to be produced and included in the bundle causing issues.

@pwa-tapptic
Copy link

Do you have any news on this? I've got exactly the same issue and workaround proposed by @Drarig29 works on my side.

@Drarig29
Copy link
Author

Drarig29 commented Aug 12, 2023

@kirill-ivlev if you haven't noticed, I proposed a PR to fix that already.

we've added this feature request to our backlog

This is not a feature request, but a bug to fix.

@LanceMcCarthy
Copy link

@kirill-ivlev Has there been any consideration on merging @Drarig29 's PR?

This is particularly a problem when using ARM64 devices to package extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants