Skip to content

adapter-node on 1.0.0-next.88 still crashes on devalue package #6601

@martinbeentjes

Description

@martinbeentjes

Describe the bug

When using adapter-node on the latest version (next-88) I am still receiving errors regarding the devalue package.

CommonJS modules can always be imported via the default export, for example using:

import pkg from 'devalue';
const { devalue } = pkg;

I know that #6394, #6372 state that this has been fixed, so I suppose this is my mistake but I do not know what is wrong. Comparing to the default SvelteKit template, my configuration does not seem to mismatch. The only change done was to change the build result directory to be dist so nothing that should break it. The following is the package.json used currently.

{
	"private": true,
	"packageManager": "[email protected]",
	"engines": {
		"pnpm": "^7.0.0"
	},
	"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"package": "svelte-kit package",
		"preview": "vite preview",
		"test": "playwright test",
		"check": "svelte-check --tsconfig ./tsconfig.json",
		"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
		"lint": "prettier --check --plugin-search-dir=. .",
		"format": "prettier --write --plugin-search-dir=. ."
	},
	"devDependencies": {
		"@playwright/test": "^1.25.1",
		"@sveltejs/kit": "^1.0.0-next.471",
		"@types/cookie": "^0.5.1",
		"@types/node": "^18.7.15",
		"@types/qrcode": "^1.5.0",
		"@typescript-eslint/eslint-plugin": "^5.36.2",
		"@typescript-eslint/parser": "^5.36.2",
		"autoprefixer": "^10.4.8",
		"eslint": "^8.23.0",
		"eslint-config-prettier": "^8.5.0",
		"eslint-plugin-svelte3": "^4.0.0",
		"postcss": "^8.4.16",
		"prettier": "^2.7.1",
		"prettier-plugin-svelte": "^2.7.0",
		"svelte": "^3.50.0",
		"svelte-check": "^2.9.0",
		"svelte-preprocess": "^4.10.7",
		"tailwindcss": "^3.1.8",
		"tslib": "^2.4.0",
		"typescript": "^4.8.2",
		"vite": "^3.1.0",
		"@sveltejs/adapter-node": "^1.0.0-next.88"
	},
	"type": "module",
	"dependencies": {
		"buffer": "^6.0.3",
		"cookie": "^0.5.0",
		"dotenv": "^16.0.2",
	}
}

Reproduction

When creating a SvelteKit project, using the default template, with TypeScript / eslint / playwright and all. When changing the adapter to adapter-node and importing that in the svelte config file, the project does not work.

I have created a StackBlitz project with this setup:

https://stackblitz.com/edit/typescript-fbdbs4?file=package.json

Logs

No response

System Info

System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 66.97 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 17.4.0 - ~/.nvm/versions/node/v17.4.0/bin/node
    npm: 8.10.0 - ~/.nvm/versions/node/v17.4.0/bin/npm
  Browsers:
    Chrome: 104.0.5112.101
    Firefox: 104.0.1
    Safari: 15.6.1
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.88 => 1.0.0-next.88 
    @sveltejs/kit: ^1.0.0-next.471 => 1.0.0-next.471 
    svelte: ^3.50.0 => 3.50.0 
    vite: ^3.1.0 => 3.1.0

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions