roxiness / routify-starter

https://example.routify.dev/
198 stars 55 forks source link

Netlify deloy stuck on created dist/sw.js #66

Closed Gibbu closed 4 years ago

Gibbu commented 4 years ago

Bug description When deploying to Netlify the build process will get stuck on created dist/sw.js.

package.json

{
  "name": "svelte-app",
  "version": "1.0.0",
  "scripts": {
    "dev": "run-p routify rollup",
    "dev:nollup": "run-p routify nollup",
    "dev-dynamic": "cross-env BUNDLING=dynamic npm run dev",
    "build": "routify -b && rollup -c && routify export && workbox injectManifest",
    "serve": "spassr --serve-spa --serve-ssr",
    "export": "routify export",
    "build:docker": "npm run build && ./scripts/docker/docker-build.sh",
    "deploy:vercel": "cd scripts/vercel && npm run deploy",
    "deploy:netlify": "cd scripts/netlify && npm run deploy",
    "rollup": "rollup -cw",
    "nollup": "nollup -c",
    "routify": "routify"
  },
  "devDependencies": {
    "@rollup/plugin-alias": "^3.1.1",
    "@rollup/plugin-commonjs": "^13.0.0",
    "@rollup/plugin-node-resolve": "^8.1.0",
    "@simonwep/pickr": "^1.7.4",
    "axios": "^0.20.0",
    "concurrently": "^5.2.0",
    "cross-env": "^7.0.2",
    "deepdash": "^5.3.0",
    "del": "^5.1.0",
    "file-saver": "^2.0.2",
    "nollup": "^0.12.0",
    "npm-run-all": "^4.1.5",
    "rollup": "^2.18.1",
    "rollup-plugin-copy-watch": "0.0.1",
    "rollup-plugin-hot": "^0.0.31",
    "rollup-plugin-livereload": "^1.3.0",
    "rollup-plugin-scss": "^2.6.0",
    "rollup-plugin-svelte": "^5.2.3",
    "rollup-plugin-svelte-hot": "^0.10.0",
    "rollup-plugin-terser": "^6.1.0",
    "spassr": "^1.1.2",
    "svelte-portal": "^1.0.0"
  },
  "dependencies": {
    "@rollup/plugin-replace": "^2.3.3",
    "@sveltech/routify": "^1.9.7",
    "svelte": "^3.23.2",
    "svelte-preprocess": "^4.0.8",
    "workbox-cli": "^5.1.3"
  },
  "routify": {
    "extensions": "svelte,html,svx,md",
    "dynamicImports": true,
    "routifyDir": ".routify"
  }
}

Version Routify 1.9.7 Svelte 3.23.2

Additional information Netlify build log: https://pastebin.com/raw/cbk5DMP3 Project repo: https://github.com/Gibbu/Website

jakobrosenberg commented 4 years ago

How are you deploying to Netlify? Github link or npm run deploy:netlify?

Gibbu commented 4 years ago

Github link

jakobrosenberg commented 4 years ago

What's your Github link config?

Gibbu commented 4 years ago

Are you talking about the build settings? If so: image

jakobrosenberg commented 4 years ago

Yup. You need to set your base directory to scripts/netlify.

https://routify.dev/guide/starter-Template/deployment

Gibbu commented 4 years ago

It still gets stuck. https://pastebin.com/raw/kCaRVQ9v

Just to clarify this is how it should look, no? image

jakobrosenberg commented 4 years ago

That looks correct and I couldn't find any errors in your log.

What happens if you cd into scripts/netlify and run npm run build? Does it hang at the end?

Gibbu commented 4 years ago

Indeed: https://pastebin.com/raw/DjbJb2nX

jakobrosenberg commented 4 years ago

Are you using Typescript by any chance? I might be on to something.

Gibbu commented 4 years ago

I am not. If you want to check out my current files: https://github.com/Gibbu/Website

jakobrosenberg commented 4 years ago

I think I finally found the cause.

scripts/base.config.js, line 71. watch: 'static', needs to be watch: !production && 'static'.

Can I ask how you created the project?

Gibbu commented 4 years ago

Sure, I ran npx @sveltech/routify init and swapped out the regular rollup-plugin-copy module with the rollup-plugin-copy-watch and added the watch property from our conversation from Discord image

jakobrosenberg commented 4 years ago

That explains it. If you add the !production &&, you should be fine.