fix: replace object shorthand to fix Rollup parse error#268
Closed
hoah2333 wants to merge 1 commit intojsdom:mainfrom
Closed
fix: replace object shorthand to fix Rollup parse error#268hoah2333 wants to merge 1 commit intojsdom:mainfrom
hoah2333 wants to merge 1 commit intojsdom:mainfrom
Conversation
Disable `object-shorthand` eslint rule to ensure compatibility with bundlers that fail to parse shorthand properties in this file.
Member
|
This is a bug in Rollup, which you should report there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using jsdom in a Svelte 5 environment, the build fails due to a syntax error in cssstyle.
I added jsdom to a Svelte 5 project and only used the following minimal code:
However, running
vite buildresults in the following error:This error originates from the following object literal in
font.jsThe shorthand property syntax (
{ global }) is not correctly handled by Rollup in this build setup, which causes the parser to throw a syntax error during bundling.Replacing the shorthand property with an explicit key-value pair resolves the issue:
After applying this change,
vite buildcompletes successfully in the Svelte 5 environment.