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

feat: integrate vite runtime #155

Merged
merged 69 commits into from
Feb 9, 2024
Merged

feat: integrate vite runtime #155

merged 69 commits into from
Feb 9, 2024

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Jan 21, 2024

todo

@hi-ogawa hi-ogawa changed the base branch from main to fix-vite-node-ssr-optimizeDeps January 21, 2024 00:59
@hi-ogawa hi-ogawa force-pushed the refactor-vite-runtime branch 2 times, most recently from ea37af2 to 385dc74 Compare January 21, 2024 01:47
@hi-ogawa hi-ogawa mentioned this pull request Jan 28, 2024
19 tasks
@hi-ogawa hi-ogawa marked this pull request as ready for review January 31, 2024 02:31
@hi-ogawa hi-ogawa force-pushed the refactor-vite-runtime branch 2 times, most recently from 9246184 to 322c69e Compare February 1, 2024 00:21
Base automatically changed from fix-vite-node-ssr-optimizeDeps to main February 9, 2024 01:06
@@ -12,6 +12,7 @@ export default defineConfig({
"react/jsx-dev-runtime",
"react-dom",
"react-dom/server.browser",
"@remix-run/server-runtime",
Copy link
Owner Author

@hi-ogawa hi-ogawa Feb 9, 2024

Choose a reason for hiding this comment

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

Previously vite-node was providing exports etc... in global, so it was magically working.

https://github.com/vitest-dev/vitest/blob/5ed537f03ea33df3516e530b55a5c1f0fc219e24/packages/vite-node/src/client.ts#L392-L395

Now, vite-runtime doesn't provide these out-of-the-box, so we get this error unless cookie etc... are pre-bundled.

ReferenceError: exports is not defined
    at /home/hiroshi/code/personal/vite-plugins/node_modules/.pnpm/cookie@0.6.0/node_modules/cookie/index.js:15:1
    at Object.runViteModule (__vite_node_miniflare_entry.js:2704:15)
    at ViteRuntime.directRequest (__vite_node_miniflare_entry.js:2609:23)
    at ViteRuntime.cachedRequest (__vite_node_miniflare_entry.js:2489:28)
    at request (__vite_node_miniflare_entry.js:2539:19)
    at /@fs/home/hiroshi/code/personal/vite-plugins/node_modules/.pnpm/@remix-run+server-runtime@2.5.1_typescript@5.1.6/node_modules/@remix-run/server-runtime/dist/esm/cookies.js?v=83897ad1:1:110
    at Object.runViteModule (__vite_node_miniflare_entry.js:2704:9)
    at ViteRuntime.directRequest (__vite_node_miniflare_entry.js:2609:5)
    at ViteRuntime.cachedRequest (__vite_node_miniflare_entry.js:2492:33)
    at /@fs/home/hiroshi/code/personal/vite-plugins/node_modules/.pnpm/@remix-run+server-runtime@2.5.1_typescript@5.1.6/node_modules/@remix-run/server-runtime/dist/esm/index.js?v=83897ad1:1:110

@hi-ogawa hi-ogawa merged commit 943abf3 into main Feb 9, 2024
3 checks passed
@hi-ogawa hi-ogawa deleted the refactor-vite-runtime branch February 9, 2024 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant