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

document.documentElement.setAttribute is not a function #406

Open
5 of 7 tasks
rezelute opened this issue Jun 20, 2024 · 0 comments
Open
5 of 7 tasks

document.documentElement.setAttribute is not a function #406

rezelute opened this issue Jun 20, 2024 · 0 comments

Comments

@rezelute
Copy link

Describe the bug

On vite-ssg version: 0.23.0 (and onwards) with critters 0.0.20, ive started getting the following error when trying to build ...

file:///.../node_modules/vite-ssg/dist/node.mjs:1058
        throw new Error(`${gray("[vite-ssg]")} ${red(`Error on page: ${cyan(route)}`)}
              ^

Error: [vite-ssg] Error on page: /
TypeError: document.documentElement.setAttribute is not a function
    at createDocument (file:///.../node_modules/critters/dist/critters.mjs:519:30)
    at Critters.process (file:///.../node_modules/critters/dist/critters.mjs:1123:22)
    at file:///.../node_modules/vite-ssg/dist/node.mjs:1048:40    
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///.../node_modules/vite-ssg/dist/node.mjs:707:36
    at file:///.../node_modules/vite-ssg/dist/node.mjs:1058:15    
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///.../node_modules/vite-ssg/dist/node.mjs:707:36

Node.js v20.14.0
node:child_process:965
    throw err;
    ^

Error: Command failed: vue-tsc --noEmit && vite-ssg build
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at Object.<anonymous> (C:\...\npm-build.js:17:26)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 82856,
  stdout: null,
  stderr: null
}

Node.js v20.14.0

Reproduction

Use vite ssg 0.23.0 with critters 0.0.20

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 11.25 GB / 31.92 GB
  Binaries:
    Node: 20.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (126.0.2592.61)

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant