svelte-adapter-azure-swa icon indicating copy to clipboard operation
svelte-adapter-azure-swa copied to clipboard

Unable to build app with pnpm

Open geoffrich opened this issue 2 years ago • 2 comments

Installing the adapter in a fresh demo project with pnpm and running pnpm build throws the following error:

> Using adapter-azure-swa
✘ [ERROR] Could not resolve "set-cookie-parser"

    .svelte-kit/azure-tmp/headers.js:1:35:
      1 │ import * as set_cookie_parser from 'set-cookie-parser';
        ╵                                    ~~~~~~~~~~~~~~~~~~~

  You can mark the path "set-cookie-parser" as external to exclude it from the
  bundle, which will remove this error.

error during build:
Error: Build failed with 1 error:
.svelte-kit/azure-tmp/headers.js:1:35: ERROR: Could not resolve "set-cookie-parser"
    at failureErrorWithLog (/Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1575:15)
    at /Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1033:28
    at /Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:978:67
    at buildResponseToResult (/Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1031:7)
    at /Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1143:14
    at responseCallbacks.<computed> (/Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:680:9)
    at handleIncomingPacket (/Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:735:9)
    at Socket.readFromStdout (/Users/grich/code/throwaway/pnpm-test/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:656:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
 ELIFECYCLE  Command failed with exit code 1.

More context: https://github.com/geoffrich/svelte-adapter-azure-swa/issues/118

The official Netlify adapter uses the same set-cookie-parser dependency and builds successfully, so I'm not sure what we're doing differently.

geoffrich avatar Mar 23 '23 18:03 geoffrich

#133 links this issue in the README. We should remove that line once the issue is resolved.

geoffrich avatar Mar 23 '23 19:03 geoffrich

Noticed this too. It is weird since the package.json seems to be all good. Currently been working around this by just installing set-cookie-parser with the adapter package

pnpm i -D set-cookie-parser

bertybot avatar Mar 30 '23 14:03 bertybot