Skip to content

[adapter-static] Strict mode is undefined and causes build to error out #7340

@CobyPear

Description

@CobyPear

Describe the bug

When building the Demo App with @sveltejs/adapter-static, I am getting an error about strict being undefined (Posted full error in logs)

Reproduction

Here is a repro repo with a branch containing the minimal reproduction: https://github.com/CobyPear/hack-sveltekit-ssg/tree/adapter-error-repro

Steps to repro:

  1. create a new SvelteKit demo app with all extras and TypeScript
  2. uninstall @sveltejs/adapter-auto
  3. install @sveltejs/adapter-static
  4. run npm run build in the terminal

Expected: Build succeeds (or yells at me about dynamic routes)
Actual: see error in Logs below

Logs

> Using @sveltejs/adapter-static
error during build:
TypeError: Cannot read properties of undefined (reading 'strict')
    at adapt (file:///Users/path-to-project/node_modules/@sveltejs/adapter-static/index.js:27:46)
    at adapt (file:///Users/path-to-project/node_modules/@sveltejs/kit/src/core/adapt/index.js:28:8)
    at Object.handler (file:///Users/path-to-project/node_modules/@sveltejs/kit/src/exports/vite/index.js:493:12)
    at async PluginDriver.hookParallel (file:///Users/path-to-project/node_modules/rollup/dist/es/shared/rollup.js:22632:17)
    at async Object.close (file:///Users/path-to-project/node_modules/rollup/dist/es/shared/rollup.js:23709:13)
    at async Promise.all (index 0)
    at async build (file:///Users/path-to-project/node_modules/vite/dist/node/chunks/dep-4da11a5e.js:45667:13)
    at async CAC.<anonymous> (file:///Users/path-to-project/node_modules/vite/dist/node/cli.js:748:9)

System Info

System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Pro
    Memory: 194.31 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - ~/.yarn/bin/yarn
    npm: 8.19.2 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 106.0.5249.119
    Firefox: 106.0.1
    Safari: 16.0
  npmPackages:
    @sveltejs/adapter-static: ^1.0.0-next.45 => 1.0.0-next.45
    @sveltejs/kit: next => 1.0.0-next.520
    svelte: ^3.46.0 => 3.52.0
    vite: ^3.1.0 => 3.1.8

Severity

serious, but I can work around it

Additional Information

I was able to work around this by explicitly defining the option in the adapter, but this shouldn't be necessary to my understanding.

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