sveltejs / sapper-template

Starter template for Sapper apps
703 stars 214 forks source link

windows rollup fail #237

Open qwabra opened 4 years ago

qwabra commented 4 years ago

windows rollup fail

npm/yarn nodejs 12/14 windows 10

rollup

npx degit "sveltejs/sapper-template#rollup" my-app

> Executing task: yarn run dev <

yarn run v1.22.4
warning package.json: No license field
$ sapper dev
• server
'@sapper/server' is imported by src\server.js, but could not be resolved – treating it as an external dependency
• client
'@sapper/app' is imported by src\client.js, but could not be resolved – treating it as an external dependency   
• service worker
'@sapper/service-worker' is imported by src\service-worker.js, but could not be resolved – treating it as an external dependency
'routes' is imported from external module '@sapper/service-worker' but never used
No name was provided for external module '@sapper/service-worker' in output.globals – guessing 'serviceWorker'
internal/modules/cjs/loader.js:1033
  throw err;
  ^

Error: Cannot find module '@sapper/server'
Require stack:
- W:\svelte\my-app\__sapper__\dev\server\server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (W:\svelte\my-app\__sapper__\dev\server\server.js:8:14)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'W:\\svelte\\my-app\\__sapper__\\dev\\server\\server.js' ]
}
> Server crashed
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

webpack

npx degit "sveltejs/sapper-template#webpack" my-app

hmm, webpack, hotreload din't work !?

from browser console:

Uncaught TypeError: Cannot read property 'status' of undefined
    at check (sapper-dev-client.js:6)
    at EventSource.source.onmessage (sapper-dev-client.js:37)
qwabra commented 4 years ago

windows docker

inside docker compile is ok, but ... watcher didn't work

# docker-compose.yml
version: '3'
services:
  dev:
    image: node:12-alpine
    volumes:
      # 
      - .:/workspace
      # 
      # - nodemodules:/workspace/node_modules
      - /workspace/node_modules
      - /workspace/__sapper__
      - /workspace/src/node_modules
      # 
      # - /workspace/dist
      # - /workspace/.cache
      # 
      # - /etc/letsencrypt:/etc/letsencrypt
      # - /var/lib/letsencrypt:/var/lib/letsencrypt
    environment:
      - NODE_ENV=development
      - PORT=80
    working_dir: /workspace/
    ports:
      - 80:80
      - 10000:10000
    tty: true
# volumes:
#   nodemodules:
#     external: true
qwabra commented 4 years ago

wsl 2, rollup

watcher

vscode "open foler inside WSL"(WSL addon) - fail copy folder to home dir(inside WSL), and open it use code . - look like ok

hotreload

http://127.0.0.1:3000/ - fail (look like vscode route) http://192.168.88.233:3000/ - fail (look like vscode route) http://localhost:3000/ - is ok

https://github.com/sveltejs/sapper/issues/485

antony commented 4 years ago

Hi @qwabra

I'm assuming you are trying to build the template on your windows machine. I'm a little confused at what part Docker plays in this?

qwabra commented 4 years ago

I try different ways of working from under Windows in search of a working solution.

qwabra commented 4 years ago

So, for Windows, single work solution for me - is WSL 1 (rollup is checked )