Skip to content

fix(js/scripts/build.sh): fix wasm init problem when run build in vite(#1393)#1396

Open
ticky-xia wants to merge 1 commit into
geoarrow:mainfrom
ticky-xia:patch-1
Open

fix(js/scripts/build.sh): fix wasm init problem when run build in vite(#1393)#1396
ticky-xia wants to merge 1 commit into
geoarrow:mainfrom
ticky-xia:patch-1

Conversation

@ticky-xia

@ticky-xia ticky-xia commented Nov 11, 2025

Copy link
Copy Markdown

Added sideEffects field to package.json update.

Closes #1393

Added sideEffects field to package.json update.
@github-actions github-actions Bot added the fix label Nov 11, 2025
@ticky-xia ticky-xia changed the title fix(js/scripts/build.sh): fix wasm init problem when run build in vite fix(js/scripts/build.sh): fix wasm init problem when run build in vite(#1393) Nov 12, 2025
@kylebarron

Copy link
Copy Markdown
Member

Thanks! Can you provide some sort of reference that shows this is needed?

@ticky-xia

Copy link
Copy Markdown
Author

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only want this to apply to the code in bundler/ and not in all three submodules.

If you run

wasm-pack build --out-dir tmp_build/node \
  --out-name index \
  --target nodejs

then the generated module does not have a .sideEffects field.

And if you build for the web endpoint,

wasm-pack build --out-dir tmp_build/esm \
  --out-name index \
  --target web

then the generated package.json only has "./snippets/*" in the side effects; index.js is not included in the sideEffects array.

So I think you need to set

.sideEffects: [
	"bundler/index.js",
	"bundler/snippets/*",
	"node/snippets/*"
]

@ticky-xia
ticky-xia requested a review from kylebarron December 15, 2025 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When run build in vite, it doesnt work in production

2 participants