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

adapter-node ^1.0.0-next.64 - Cannot read properties of undefined (reading 'protocol') #3420

Closed
stolinski opened this issue Jan 19, 2022 · 4 comments · Fixed by #3423
Closed
Labels
bug Something isn't working pkg:adapter-node

Comments

@stolinski
Copy link

stolinski commented Jan 19, 2022

Describe the bug

svelte-kit build with
"@sveltejs/adapter-node": "^1.0.0-next.64",
"@sveltejs/kit": "^1.0.0-next.234",

Reproduction

https://stackblitz.com/edit/sveltekit-teapcf?file=svelte.config.js

Logs

Cannot read properties of undefined (reading 'protocol')
    at default (file:///Users/scotttolinski/Sites/Level-Up-Tutorials/node_modules/.pnpm/@[email protected]/node_modules/@sveltejs/adapter-node/index.js:22:14)
    at file:///Users/scotttolinski/Sites/Level-Up-Tutorials/packages/ui/svelte.config.js:24:12
    at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
    at async load_config (file:///Users/scotttolinski/Sites/Level-Up-Tutorials/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:849:17)
    at async file:///Users/scotttolinski/Sites/Level-Up-Tutorials/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:983:19

System Info

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 22.76 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v17.0.1/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v17.0.1/bin/npm
  Browsers:
    Chrome: 97.0.4692.71
    Firefox: 95.0.2
    Firefox Developer Edition: 96.0
    Safari: 15.2
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.234
    svelte: ^3.44.3 => 3.46.2

Severity

blocking an upgrade

Additional Information

No response

@stolinski stolinski changed the title adapter-node - Cannot read properties of undefined (reading 'protocol') adapter-node ^1.0.0-next.64 - Cannot read properties of undefined (reading 'protocol') Jan 19, 2022
@nergmada
Copy link

I've had this same issue too, I've found that if you configure environment variable in your adapter config in svelte.config.js this error goes away

adapter: adapter({
	env: {
		headers: {
			protocol: undefined,
		}
	}
}),

But now it's throwing an error regarding BASE_ENV

@lovasoa
Copy link
Contributor

lovasoa commented Jan 20, 2022

@nergmada : I opened a separate issue about the base_env problem: #3424

@lovasoa
Copy link
Contributor

lovasoa commented Jan 20, 2022

But I think the root problem is that there doesn't seem to be automated tests that can catch adapter-node crashing in its default configuration

@ranjanified

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:adapter-node
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants