-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
fix: build target for vercel will throw error #699
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
975539e
to
655893e
Compare
655893e
to
84f2c87
Compare
84f2c87
to
8f37db7
Compare
@@ -38,7 +38,7 @@ export function rscServePlugin(opts: { | |||
config(viteConfig) { | |||
// FIXME This seems too hacky (The use of viteConfig.root, '.', path.resolve and resolveFileName) | |||
const entriesFile = resolveFileName( | |||
path.resolve(viteConfig.root || '.', opts.srcDir, SRC_ENTRIES + '.js'), | |||
path.resolve(viteConfig.root || '.', opts.srcDir, SRC_ENTRIES), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try this?
path.resolve(viteConfig.root || '.', opts.srcDir, SRC_ENTRIES), | |
path.resolve(viteConfig.root || '.', opts.srcDir, SRC_ENTRIES + '.jsx'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, it seems ok as well.
421a9a2
to
07bc408
Compare
07bc408
to
5c78210
Compare
All the windows tests are failed. Maybe there are another issues? |
probably, wrap with |
0bff899
to
f41d004
Compare
Ha, you are right |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great it works. Thanks for your contribution!
I really appreciate it. (As noted as "FIXME", I'm not super comfortable with the current solution. Hopefully, we will revisit it.)
I see the failed test stuck on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't notice before. Can you try this please?
const entriesFile = resolveFileName( | ||
path.resolve(viteConfig.root || '.', opts.srcDir, SRC_ENTRIES + '.js'), | ||
normalizePath( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, on second look, I think normalizePath should be outside of resolveFileName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I think you are right. resolveFileName will use node:fs to check file exists.
e2e/multi-platform.spec.ts
Outdated
import { rm } from 'node:fs/promises'; | ||
import { expect } from '@playwright/test'; | ||
|
||
const cwd = fileURLToPath(new URL('../examples/01_template', import.meta.url)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add test with 20_minimal
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the adjustment.
Solve #700
The bug was introduced in #682, the reason is that the logic of https://github.com/dai-shi/waku/pull/682/files#diff-6de2cc9d9f6423e3f4faa0cb1a6200112f1bc057af0db1a9362fe6117c51d18aR79-R82 was adjusted.
I think the logic now assmues the entry file is endsWith .jsx while while the dynamic import in serve-vercel.js is endsWith .js
I am not so sure it is a correct way to remove .js extension, but I added the dry run testing, maybe it can help.