michmich112 / sveltekit-adapter-chrome-extension

Sveltekit adapter for making chrome extensions
MIT License
116 stars 16 forks source link

Error while building: "TypeError: getStaticDirectory is not a function" #21

Closed williamwong closed 1 year ago

williamwong commented 1 year ago

This breaking change https://github.com/sveltejs/kit/issues/7800 removed getStaticDirectory() from the builder, resulting in the following error during build:

error during build:
TypeError: getStaticDirectory is not a function
    at reWriteExtensionManifest (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/sveltekit-adapter-chrome-extension/index.js:154:31)
    at adapt (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/sveltekit-adapter-chrome-extension/index.js:67:7)
    at async adapt (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/@sveltejs/kit/src/core/adapt/index.js:28:2)
    at async Object.handler (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/@sveltejs/kit/src/exports/vite/index.js:522:6)
    at async PluginDriver.hookParallel (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/rollup/dist/es/shared/rollup.js:22670:17)
    at async Object.close (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/rollup/dist/es/shared/rollup.js:23750:13)
    at async Promise.all (index 0)
    at async build (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:45242:13)
    at async CAC.<anonymous> (file:///Users/will/DevTest/sveltekit-extension-test/node_modules/vite/dist/node/cli.js:756:9)

It seems like replacing that call with getClientDirectory() should work instead.

JustMrMendez commented 1 year ago

same

michmich112 commented 1 year ago

@williamwong @JustMrMendez - v1.5.0 should fix this issue. Please let me know if this issue persists even when bumping up to that version

williamwong commented 1 year ago

@michmich112 seems to work perfectly, thanks!