[adapter-vercel] Build fails - path to bundle not being correctly outputted on Windows?
See original GitHub issueDescribe the bug
- run npm run build on SvelteKit project (was working fine before updating vercel-adapter)
ER: Project builds successfully AR: The following errors:
> Using @sveltejs/adapter-vercel
> .svelte-kit/vercel-tmp/entry.js:3:20: error: Could not resolve "..outputserver/app.js" (mark it as external to exclude it from the bundle)
3 │ import { App } from '..\output\server/app.js';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:8:16: error: Could not resolve "..outputserver/nodes/0.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
8 │ () => import('..\output\server/nodes/0.js'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:9:16: error: Could not resolve "..outputserver/nodes/1.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
9 │ () => import('..\output\server/nodes/1.js'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:10:16: error: Could not resolve "..outputserver/nodes/4.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
10 │ () => import('..\output\server/nodes/4.js'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:11:16: error: Could not resolve "..outputserver/nodes/5.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
11 │ () => import('..\output\server/nodes/5.js')
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note the paths have forward slashes and the error path seems wrong > ..outputserver
instead of ..\output\server
, looks like \
is not being escaped properly perhaps? This would only show up on Windows and iirc no Svelte maintainers use Windows??
I would love to submit a PR but would need some guidance.
Reproduction
https://github.com/CobyPear/adapter-vercel-repro
clone the repo, npm i
and npm run build
should show the following errors in the console (on WIndows 11, will check Ubuntu if I have time):
> .svelte-kit/vercel-tmp/entry.js:3:20: error: Could not resolve "..outputserver/app.js" (mark it as external to exclude it from the bundle)
3 │ import { App } from '..\output\server/app.js';
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:8:16: error: Could not resolve "..outputserver/nodes/0.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
8 │ () => import('..\output\server/nodes/0.js'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:9:16: error: Could not resolve "..outputserver/nodes/1.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
9 │ () => import('..\output\server/nodes/1.js'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .svelte-kit/vercel-tmp/manifest.js:10:16: error: Could not resolve "..outputserver/nodes/2.js" (mark it as external to exclude it from the bundle, or add ".catch()" to handle the failure at run-time)
10 │ () => import('..\output\server/nodes/2.js')
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
### Logs
_No response_
### System Info
```shell
for the reproduction project:
System:
OS: Windows 10 10.0.22000
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 4.96 GB / 15.89 GB
Binaries:
Node: 16.8.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
npm: 7.21.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 96.0.4664.110
Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.62)
Internet Explorer: 11.0.22000.120
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.7
@sveltejs/adapter-vercel: next => 1.0.0-next.34
@sveltejs/kit: next => 1.0.0-next.211
svelte: ^3.44.0 => 3.44.3
Not sure how accurate that is. I'm on Windows 11
Severity
blocking an upgrade
Additional Information
Not sure how to work around this at the moment, any help is much appreciated 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Build fails in release mode - Microsoft Q&A
Trying to learn wxWidgets. The basic Hello World file compiles in debug but not in release. The first few lines look like this....
Read more >"This bundle is invalid. The bundl… | Apple Developer Forums
The bundle at path [path] has an invalid CFBundleIdentifier. ... what I believe the issue is), the app will not run on a...
Read more >Invalid path in TextDataProvider while using AssetBundle ...
build the addressables via Unity > Addressables groups > build > New ... I having an error about "TextDataProvider" since I use "AssetBundle...
Read more >Howto: Building R 4.2 and packages on Windows - R Project
R and packages are built using Rtools, which is a collection of build tools ... the package doesn't build due to say linking...
Read more >bundle-config - - Set bundler configuration options
path. The location to install the specified gems to. This defaults to Rubygems' setting. Bundler shares this location with Rubygems, gem install ....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
same error on vercel. I am using a mac.
Yup updating npm worked for me. Thanks @gpaiva985 !