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

Error building with Azure Static Web Apps CI/CD #14

Closed
KodjoSuprem opened this issue Dec 31, 2021 · 1 comment
Closed

Error building with Azure Static Web Apps CI/CD #14

KodjoSuprem opened this issue Dec 31, 2021 · 1 comment

Comments

@KodjoSuprem
Copy link

KodjoSuprem commented Dec 31, 2021

building locally works.

> Using adapter-azure-swa
  ✔ done

But the github action fails with this error :

 Using adapter-azure-swa
2021-12-31T16:37:04.7274708Z > Cannot read property 'log' of undefined
2021-12-31T16:37:04.7279227Z TypeError: Cannot read property 'log' of undefined
2021-12-31T16:37:04.7283877Z     at adapt (file:///github/workspace/node_modules/svelte-adapter-azure-swa/index.js:21:10)
2021-12-31T16:37:04.7293223Z     at adapt (file:///github/workspace/node_modules/@sveltejs/kit/dist/chunks/index5.js:623:8)
2021-12-31T16:37:04.7294268Z     at file:///github/workspace/node_modules/@sveltejs/kit/dist/cli.js:948:11
2021-12-31T16:37:04.7421977Z npm ERR! code ELIFECYCLE
2021-12-31T16:37:04.7426868Z npm ERR! errno 1

The Vite build is OK. Modules are transformed...

Only the adapter part fails.

I have checked my local version of node_modules/@sveltejs/kit/dist/chunks/index5.js:623:8 and I don't have 623 lines.

Why would the pipeline download a different version tho...

My pipeline file is the same as

https://github.com/geoffrich/sveltekit-azure-swa-demo/blob/main/.github/workflows/azure-static-web-apps-delightful-bush-01bdb9a0f.yml

my package.json

{
  "name": "myproject",
  "version": "0.0.1",
  "scripts": {
    "dev": "svelte-kit dev",
    "devh": "svelte-kit dev --host",
    "build": "svelte-kit build",
    "preview": "svelte-kit preview",
    "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
    "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
  },
  "devDependencies": {
    "@sveltejs/adapter-static": "^1.0.0-next.24",
    "@sveltejs/kit": "next",
    "autoprefixer": "^10.4.0",
    "eslint": "^7.32.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-svelte3": "^3.2.1",
    "postcss": "^8.4.4",
    "prettier": "^2.4.1",
    "prettier-plugin-svelte": "^2.4.0",
    "svelte": "^3.42.6",
    "svelte-adapter-azure-swa": "^0.1.0",
    "tailwindcss": "^3.0.1"
  },
  "type": "module"
}

@geoffrich
Copy link
Owner

Thanks for the report! This is due to breaking changes to the adapter API introduced by SvelteKit next-208, which was released yesterday. I still need to update this adapter to work with the latest version of SvelteKit. You can follow #6 for updates.

Because SvelteKit has the version as "next" in your package.json, CI will grab the latest version, which is different than your local version. To work around this issue for now, you should manually install the SvelteKit version you have locally, which you can find in your package-lock.json. The latest version that will work with this adapter is next-206.

npm i @sveltejs/kit@1.0.0-next.206

By specifying which version to use in your package.json, your pipeline should use the same version you have locally.

I'll add a note to the README about the current version limitations. Closing in favor of #6.

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

2 participants