Closed jagmeethanspal closed 2 years ago
It will build with these changes to node_modules\sveltekit-adapter-browser-extension\adapter-browser-extension.mjs:
Replace line 50 with async adapt(utils) {
Replace lines 56 with utils.writeStatic(assets)
Replace line 57 with utils.writeClient(assets)
Sveltekit adapters require an adapt
function, exported for use during the build process. Before, Sveltekit would pass an object to the adapt
function with property utils
. Destructuring the object that Sveltekit passes when you build your project, expecting the property utils
, no longer works since Sveltekit's has changed their API.
The functions from utils
are now at the root of the object passed, so the adapt
function should no longer use destructuring. Also, Sveltekit has changed two of those function names, which must be changed.
Pull requests and work on other's repositories is new to me. Here is my attempt to fork, branch, and create a pull request with the changes.
Edit: I've removed the fork since there is a better update.
https://github.com/FireMakeThunder/sveltekit-adapter-browser-extension/pull/1
See issue https://github.com/antony/sveltekit-adapter-browser-extension/pull/9
I believe this has been fixed with the recently opened PR which is now merged. Have a go and see if you have better luck!
Using a default Svelte sitekit demo example code. With earlier versions of Svelte (without Sitekit) I used the generated outputs in the 'build/public' directory (along with some additions like manifest.json) to use it as an extension.
But, with the new sitekit versions, thinking of using your adaptor for a Browser Extention, but it errors out with the following logs:
The environment is Ubuntu on Windows (WSL) and following are the versions:
Note: The @adaptor-node works fine to get the 'build' output but I also get the server/client directories (and I am not sure if the Browser would like them for an addon/extension)