michmich112 / sveltekit-adapter-chrome-extension

Sveltekit adapter for making chrome extensions
MIT License
108 stars 17 forks source link

Error while buiding "Cannot read properties of undefined (reading 'data')" in index.js #15

Closed CalmProton closed 1 year ago

CalmProton commented 1 year ago

I've installed this thing and added the adapter to my svelte.config.js. I'm unsure if I'm missing something or if this is a bug. Please advise

It doesn't like the "const innerScript = node.children[0].data" in index.js

> Using sveltekit-adapter-chrome-extension
  Wrote site to "build"
  Removing Inline Scripts
  ✔ Inline script extracted and saved at: build/script-12dz9tj.js
error during build:
TypeError: Cannot read properties of undefined (reading 'data')
    at file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/sveltekit-adapter-chrome-extension/index.js:126:44
    at Array.forEach (<anonymous>)
    at removeInlineScripts (file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/sveltekit-adapter-chrome-extension/index.js:116:6)
    at async adapt (file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/sveltekit-adapter-chrome-extension/index.js:57:7)
    at async adapt (file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/@sveltejs/kit/src/core/adapt/index.js:16:2)
    at async Object.closeBundle (file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/@sveltejs/kit/src/vite/index.js:460:5)
    at async Promise.all (index 0)
    at async Object.close (file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/rollup/dist/es/shared/rollup.js:23662:13)
    at async Promise.all (index 0)
    at async build (file:///C:/Users/denis/Desktop/Benis%20Extension/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:43473:13)
PS C:\Users\denis\Desktop\Benis Extension>
michmich112 commented 1 year ago

Hey @CalmProton thanks for signalling this! Is this repo public or private? I have suspicion about what could be causing this and would like to confirm.

CalmProton commented 1 year ago

@michmich112 yep, created a copy

its currently nothing more but sveltekit, tailwind, and your extension combined with my tries to set them up

michmich112 commented 1 year ago

Thanks @CalmProton ! That was indeed what I thought! It has been fixes in v1.2.3