Link to the code that reproduces this issue
https://github.com/Semanual/canparse_github_issue
To Reproduce
- Run
npm run build
- It throws an error "Property 'canParse' does not exist"
Current vs. Expected behavior
Current:
An error is thrown, as if function URL.canParse didn't exist.
Expected:
Should build with no problems, as per mozilla docs this function is built-in.
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2
Available memory (MB): 15852
Available CPU cores: 16
Binaries:
Node: 22.1.0
npm: 10.7.0
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 14.3.0-canary.40 // Latest available version is detected (14.3.0-canary.40).
eslint-config-next: N/A
react: 18.3.1
react-dom: 18.3.1
typescript: 5.1.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
I tested with next dev too, and it works as expected. For some reason, it only gives this error in next build.
Link to the code that reproduces this issue
https://github.com/Semanual/canparse_github_issue
To Reproduce
npm run buildCurrent vs. Expected behavior
Current:
An error is thrown, as if function URL.canParse didn't exist.
Expected:
Should build with no problems, as per mozilla docs this function is built-in.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2 Available memory (MB): 15852 Available CPU cores: 16 Binaries: Node: 22.1.0 npm: 10.7.0 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.3.0-canary.40 // Latest available version is detected (14.3.0-canary.40). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.1.3 Next.js Config: output: N/AWhich area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
I tested with
next devtoo, and it works as expected. For some reason, it only gives this error innext build.