Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

hangs on windows currently #10

Closed
tomcon opened this issue Dec 18, 2017 · 21 comments · Fixed by sveltejs/sapper#31
Closed

hangs on windows currently #10

tomcon opened this issue Dec 18, 2017 · 21 comments · Fixed by sveltejs/sapper#31

Comments

@tomcon
Copy link

tomcon commented Dec 18, 2017

error at handle_route()

Module not found: Error: Can't resolve 'c:AppsTestareasvelte_sappermyappoutes/about.html' in 'c:\Apps\Testarea\svelte_sapper\myapp.sapper'

Also error messages suggest a typo:
outes rather than routes

"./.sapper/server-routes.js
Module not found: Error: Can't resolve 'c:AppsTestareasvelte_sappermyappoutes/about.html' in 'c:\Apps\Testarea\svelte_sapper\myapp.sapper'
resolve 'c:AppsTestareasvelte_sappermyapp
outes/about.html' in 'c:\Apps\Testarea\svelte_sapper\myapp.sapper'
Parsed request is a module
using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./.sapper)
after using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./.sapper)
resolve as module
c:\Apps\Testarea\svelte_sapper\myapp.sapper\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\svelte_sapper\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\svelte\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\node_modules doesn't exist or is not a directory
c:\Apps\node_modules doesn't exist or is not a directory
c:\node_modules doesn't exist or is not a directory
looking for modules in c:\Apps\Testarea\svelte_sapper\myapp\node_modules
using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./node_modules)
after using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./node_modules)
using description file: c:\Apps\Testarea\svelte_sapper\myapp\package.json (relative path: ./node_modules/c:AppsTestareasvelte_sappermyappoutes/about.html)
no extension
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html doesn't exist
.js
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.js doesn't exist
.html
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.html doesn't exist
as directory
c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html doesn't exist
[c:\Apps\Testarea\svelte_sapper\myapp.sapper\node_modules]
[c:\Apps\Testarea\svelte_sapper\node_modules]
[c:\Apps\Testarea\svelte\node_modules]
[c:\Apps\Testarea\node_modules]
[c:\Apps\node_modules]
[c:\node_modules]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.js]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html.html]
[c:\Apps\Testarea\svelte_sapper\myapp\node_modules\c:AppsTestareasvelte_sappermyappoutes\about.html]
@ ./.sapper/server-routes.js 1:0-76"

@Rich-Harris
Copy link
Member

It's not a typo — it's almost as if it thinks path\to\routes is path\to[CARRIAGE_RETURN]outes? Am very confused by this.

It also looks like maybe it's resolving .sapper as ${cwd}.sapper rather than ${cwd}\.sapper. Which if true is, ugh. Windows!

@tomcon
Copy link
Author

tomcon commented Dec 18, 2017

Think you're right re. carriage returns @Rich-Harris

It was wrapping in places in the output but I wasn't sure if it was my editor!

@rtorr
Copy link

rtorr commented Dec 18, 2017

This is an issue on Windows 10 as well (probably know that)

@Rich-Harris
Copy link
Member

I didn't, but I assumed as much! I'm not really any closer to figuring out what's going on, so if you have any ideas...

@Rich-Harris
Copy link
Member

Ok, I've released a new version of Sapper — 0.2 — and the tests appear to be passing in Windows now. Could you try updating please?

As well as bumping the version, you'll need to add the following to package.json:

  "scripts": {
    "dev": "node server.js",
+    "build": "sapper build",
    "start": "cross-env NODE_ENV=production node server.js",
+    "prestart": "npm run build",
    "cy:run": "cypress run",
    "cy:open": "cypress open",
    "test": "run-p --race dev cy:run"
},

At least then if it still fails we'll be able to figure out if it's a build-time problem or a run-time problem.

@rtorr
Copy link

rtorr commented Dec 18, 2017

C:\Users\rtorruellas\personal\test-svetle  (TODO@0.0.1)
λ npm run dev

> TODO@0.0.1 dev C:\Users\rtorruellas\personal\test-svetle
> node server.js

listening on port 3000
webpack built 40c51b3ed5df4127c682 in 137ms
(node:6564) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ./.sapper/main.js
torruellaspersonal      est-svetleolve 'C:Users
untimeapp.js' in 'C:\Users\rtorruellas\personal\test-svetle\.sapper'
torruellaspersonal      est-svetle
untimeapp.js' in 'C:\Users\rtorruellas\personal\test-svetle\.sapper'
  Parsed request is a module
  using description file: C:\Users\rtorruellas\personal\test-svetle\package.json (relative path: ./.sapper)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\rtorruellas\personal\test-svetle\package.json (relative path: ./.sapper)
    resolve as module
      C:\Users\rtorruellas\personal\test-svetle\.sapper\node_modules doesn't exist or is not a directory
      C:\Users\rtorruellas\personal\node_modules doesn't exist or is not a directory
      C:\Users\node_modules doesn't exist or is not a directory
      C:\node_modules doesn't exist or is not a directory
      looking for modules in C:\Users\rtorruellas\personal\test-svetle\node_modules
        using description file: C:\Users\rtorruellas\personal\test-svetle\package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: C:\Users\rtorruellas\personal\test-svetle\package.json (relative path: ./node_modules)
torruellaspersonal      est-svetleC:\Users\rtorruellas\personal\test-svetle\package.json (relative path: ./node_modules/C:Users
untimeapp.js)pper
            no extension
              Field 'browser' doesn't contain a valid alias configuration
torruellaspersonal      est-svetle\personal\test-svetle\node_modules\C:Users
untimeapp.js doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
torruellaspersonal      est-svetle\personal\test-svetle\node_modules\C:Users
untimeapp.js.js doesn't exist
            .html
              Field 'browser' doesn't contain a valid alias configuration
torruellaspersonal      est-svetle\personal\test-svetle\node_modules\C:Users
untimeapp.js.html doesn't exist
            as directory
torruellaspersonal      est-svetle\personal\test-svetle\node_modules\C:Users
untimeapp.js doesn't exist
      looking for modules in C:\Users\rtorruellas\node_modules
        No description file found
        Field 'browser' doesn't contain a valid alias configuration
        No description file found
        no extension
          Field 'browser' doesn't contain a valid alias configuration
torruellaspersonal      est-svetlee_modules\C:Users
untimeapp.js doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
torruellaspersonal      est-svetlee_modules\C:Users
untimeapp.js.js doesn't exist
        .html
          Field 'browser' doesn't contain a valid alias configuration
torruellaspersonal      est-svetlee_modules\C:Users
untimeapp.js.html doesn't exist
        as directory
torruellaspersonal      est-svetlee_modules\C:Users
untimeapp.js doesn't exist
[C:\Users\rtorruellas\personal\test-svetle\.sapper\node_modules]
[C:\Users\rtorruellas\personal\node_modules]
[C:\Users\node_modules]
[C:\node_modules]
[C:\Users\rtorruellas\node_modules\package.json]
torruellaspersonal      est-svetlet-svetle\node_modules\C:Users
untimeapp.js]pper
torruellaspersonal      est-svetlet-svetle\node_modules\C:Users
untimeapp.js.js]r
torruellaspersonal      est-svetle\C:Users
untimeapp.js\package.json]
torruellaspersonal      est-svetlet-svetle\node_modules\C:Users
untimeapp.js.html]
torruellaspersonal      est-svetle\C:Users
untimeapp.js]pper
torruellaspersonal      est-svetlet-svetle\node_modules\C:Users
untimeapp.js]pper
torruellaspersonal      est-svetle\C:Users
untimeapp.js.js]r
torruellaspersonal      est-svetle\C:Users
untimeapp.js.html]
torruellaspersonal      est-svetle\C:Users
untimeapp.js]pper
 @ ./.sapper/main.js 1:0-100
(node:6564) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Terminate batch job (Y/N)? y

C:\Users\rtorruellas\personal\test-svetle  (TODO@0.0.1)
λ cat package.json
{
  "name": "TODO",
  "description": "TODO",
  "version": "0.0.1",
  "scripts": {
    "dev": "node server.js",
    "build": "sapper build",
    "start": "cross-env NODE_ENV=production node server.js",
    "prestart": "npm run build",
    "cy:run": "cypress run",
    "cy:open": "cypress open",
    "test": "run-p --race dev cy:run"
  },
  "dependencies": {
    "compression": "^1.7.1",
    "cross-env": "^5.1.1",
    "css-loader": "^0.28.7",
    "express": "^4.16.2",
    "extract-text-webpack-plugin": "^3.0.2",
    "glob": "^7.1.2",
    "marked": "^0.3.7",
    "node-fetch": "^1.7.3",
    "npm-run-all": "^4.1.2",
    "sapper": "^0.2.0",
    "serve-static": "^1.13.1",
    "style-loader": "^0.19.0",
    "svelte": "^1.49.1",
    "svelte-loader": "^2.2.1",
    "uglifyjs-webpack-plugin": "^1.1.2",
    "webpack": "^3.10.0"
  }
}

C:\Users\rtorruellas\personal\test-svetle  (TODO@0.0.1)

I don't have a lot of time to dig deeper, but if this is still around when I do, Ill try to be a better help.

@tomcon
Copy link
Author

tomcon commented Dec 19, 2017

@Rich-Harris Re-installed and ran again with your suggested changes to package.json
installed and ran in the default my-app folder (C:\Apps\Testarea\svelte_sapper\my-app)
Definitely wrapping

"./.sapper/server-routes.js
Module not found: Error: Can't resolve 'c:AppsTestareasvelte_sappermy-app
outes/about.html' in 'c:\Apps\Testarea\svelte_sapper\my-app.sapper'
resolve 'c:AppsTestareasvelte_sappermy-app
outes/about.html' in 'c:\Apps\Testarea\svelte_sapper\my-app.sapper'
Parsed request is a module
using description file: c:\Apps\Testarea\svelte_sapper\my-app\package.json (relative path: ./.sapper)
after using description file: c:\Apps\Testarea\svelte_sapper\my-app\package.json (relative path: ./.sapper)
resolve as module
c:\Apps\Testarea\svelte_sapper\my-app.sapper\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\svelte_sapper\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\svelte\node_modules doesn't exist or is not a directory
c:\Apps\Testarea\node_modules doesn't exist or is not a directory
c:\Apps\node_modules doesn't exist or is not a directory
c:\node_modules doesn't exist or is not a directory
looking for modules in c:\Apps\Testarea\svelte_sapper\my-app\node_modules
using description file: c:\Apps\Testarea\svelte_sapper\my-app\package.json (relative path: ./node_modules)
after using description file: c:\Apps\Testarea\svelte_sapper\my-app\package.json (relative path: ./node_modules)
using description file: c:\Apps\Testarea\svelte_sapper\my-app\package.json (relative path: ./node_modules/c:AppsTestareasvelte_sappermy-app
outes/about.html)
no extension
c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html doesn't exist
.js
c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html.js doesn't exist
.html
c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html.html doesn't exist
as directory
c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html doesn't exist
[c:\Apps\Testarea\svelte_sapper\my-app.sapper\node_modules]
[c:\Apps\Testarea\svelte_sapper\node_modules]
[c:\Apps\Testarea\svelte\node_modules]
[c:\Apps\Testarea\node_modules]
[c:\Apps\node_modules]
[c:\node_modules]
[c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html]
[c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html.js]
[c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html.html]
[c:\Apps\Testarea\svelte_sapper\my-app\node_modules\c:AppsTestareasvelte_sappermy-app
outes\about.html]
@ ./.sapper/server-routes.js 1:0-77"

@Rich-Harris
Copy link
Member

Can you try a couple of things please? Try running npm run build to see if you get the same error without starting the server. And then, edit your package.json like this...

"scripts": {
-    "dev": "node server.js",
-    "build": "sapper build",
-    "start": "cross-env NODE_ENV=production node server.js",
+    "dev": "cross-env SAPPER_DEST=testdir node server.js",
+    "build": "cross-env SAPPER_DEST=testdir sapper build",
+    "start": "cross-env NODE_ENV=production SAPPER_DEST=testdir node server.js",
    "prestart": "npm run build",
    "cy:run": "cypress run",
    "cy:open": "cypress open",
    "test": "run-p --race dev cy:run"
  }

...and try npm run dev to see if it works in dev mode, and npm start to see if it works in prod mode. I'm wondering if webpack on windows somehow gets confused by the leading . character?

@Rich-Harris
Copy link
Member

(I say that because c:\Apps\Testarea\svelte_sapper\my-app.sapper looks like it's gluing the directories together)

@tomcon
Copy link
Author

tomcon commented Dec 19, 2017

After trying to debug webpack for 1-2 hours I'm feeling quite ill

  1. These may/may not help:
HarmonyImportDependency {module: null, request: "c:AppsTestareasvelte_sappermy-app\routes/api/blog/[…", userRequest: "c:AppsTestareasvelte_sappermy-app\routes/api/blog/[…", …}
importedVar:"__WEBPACK_IMPORTED_MODULE_1_c_AppsTestareasvelte_sappermy_app_outes_api_blog_slug_js__"
loc:SourceLocation {start: Position, end: Position}
module:null
range:Array(2) [78, 178]
request:"c:AppsTestareasvelte_sappermy-app\routes/api/blog/[slug].js"
type:"harmony import"
userRequest:"c:AppsTestareasvelte_sappermy-app\routes/api/blog/[slug].js"
  1. Notice slashes going in both directions on the following + import statements
// watch_compiler()
compiler.outputpath = "c:\Apps\Testarea\svelte\_sapper\my-app\.sapper/client"
 
"import about from 'c:\Apps\Testarea\svelte\_sapper\my-app\routes/about.html';
import * as api_blog_$slug$ from 'c:\Apps\Testarea\svelte\_sapper\my-app\routes/api/blog/[slug].js';
import * as api_blog_index from 'c:\Apps\Testarea\svelte\_sapper\my-app\routes/api/blog/index.js';
import blog_$slug$ from 'c:\Apps\Testarea\svelte\_sapper\my-app\routes/blog/[slug].html';
import blog_index from 'c:\Apps\Testarea\svelte\_sapper\my-app\routes/blog/index.html';
import _ from 'c:\Apps\Testarea\svelte\_sapper\my-app\routes/index.html';

export { about,api_blog_$slug$,api_blog_index,blog_$slug$,blog_index,_ };"
  1. perhaps relevant (or not)?
    module.rules.include forward slash in windows 10 webpack/webpack#5327
    module.rules.include forward slash in windows 10

@tomcon
Copy link
Author

tomcon commented Dec 19, 2017

@Rich-Harris, this is the output you were looking for

C:\Apps\Testarea\svelte_sapper\my-app>npm run dev

TODO@0.0.1 dev C:\Apps\Testarea\svelte_sapper\my-app
cross-env SAPPER_DEST=testdir node server.js

listening on port 3000
webpack built eb1651c5f8bf6f6c5fab in 188ms
(node:11416) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ./testdir/main.js
Module not found: Error: Can't resolve 'C:AppsTestareasvelte_sappermy-app
untimeapp.js' in 'C:\Apps\Testarea\svelte\_sapper\my-app\testdir'
resolve 'C:AppsTestareasvelte_sappermy-app
untimeapp.js' in 'C:\Apps\Testarea\svelte\_sapper\my-app\testdir'
  Parsed request is a module
  using description file: C:\Apps\Testarea\svelte\_sapper\my-app\package.json (relative path: ./testdir)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Apps\Testarea\svelte\_sapper\my-app\package.json (relative path: ./testdir)
    resolve as module
      C:\Apps\Testarea\svelte\_sapper\my-app\testdir\node_modules doesn't exist or is not a directory
      C:\Apps\Testarea\svelte\_sapper\node_modules doesn't exist or is not a directory
      C:\Apps\Testarea\svelte\node_modules doesn't exist or is not a directory
      C:\Apps\Testarea\node_modules doesn't exist or is not a directory
      C:\Apps\node_modules doesn't exist or is not a directory
      C:\node_modules doesn't exist or is not a directory
      looking for modules in C:\Apps\Testarea\svelte\_sapper\my-app\node_modules
        using description file: C:\Apps\Testarea\svelte\_sapper\my-app\package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: C:\Apps\Testarea\svelte\_sapper\my-app\package.json (relative path: ./node_modules)
          using description file: C:\Apps\Testarea\svelte\_sapper\my-app\package.json (relative path: ./node_modules/C:AppsTestareasvelte_sappermy-app
untimeapp.js)pper
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js.js doesn't exist
            .html
              Field 'browser' doesn't contain a valid alias configuration
              C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js.html doesn't exist
            as directory
              C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js doesn't exist
[C:\Apps\Testarea\svelte\_sapper\my-app\testdir\node_modules]
[C:\Apps\Testarea\svelte\_sapper\node_modules]
[C:\Apps\Testarea\svelte\node_modules]
[C:\Apps\Testarea\node_modules]
[C:\Apps\node_modules]
[C:\node_modules]
[C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js]pper
[C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js.js]r
[C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js.html]
[C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\C:AppsTestareasvelte_sappermy-app
untimeapp.js]pper
 @ ./testdir/main.js 1:0-97
(node:11416) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

C:\Apps\Testarea\svelte_sapper\my-app>npm run build

> TODO@0.0.1 build C:\Apps\Testarea\svelte\_sapper\my-app
> cross-env SAPPER_DEST=testdir sapper build

fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open 'C:\Apps\Testarea\svelte\_sapper\my-app\testdir\main.js'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1291:33)
    at create_client_main (C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\sapper\lib\utils\create_app.js:37:6)
    at create_app (C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\sapper\lib\utils\create_app.js:62:2)
    at module.exports (C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\sapper\lib\build.js:11:2)
    at Object.<anonymous> (C:\Apps\Testarea\svelte\_sapper\my-app\node_modules\sapper\cli\index.js:7:28)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! TODO@0.0.1 build: `cross-env SAPPER_DEST=testdir sapper build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the TODO@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\bin\npm-cache\_logs\2017-12-19T15_52_52_216Z-debug.log

@Rich-Harris
Copy link
Member

Ah, so there is a place in the code where it's assuming / and not path.sep. Weird that the tests pass on Appveyor.

I've created two branches — could you try installing from these and seeing what happens?

yarn add https://github.com/sveltejs/sapper#possible-windows-fix-1 && yarn run build
yarn add https://github.com/sveltejs/sapper#possible-windows-fix-2 && yarn run build

(or npm install if you're using npm instead, obvs)

@tomcon
Copy link
Author

tomcon commented Dec 19, 2017

: ( @Rich-Harris

Steps I took:

  1. npx degit sveltejs/sapper-template my-app
  2. cd my-app
  3. yarn
  4. yarn add https://github.com/sveltejs/sapper#possible-windows-fix-1 && yarn run build
  5. yarn add https://github.com/sveltejs/sapper#possible-windows-fix-2 && yarn run build

output from (4) - (5 is below) :

$ sapper build
Hash: 1ca3416cc335010c2aef
Version: webpack 3.10.0
Time: 218ms
                       Asset       Size  Chunks             Chunk Names
main.1ca3416cc335010c2aef.js  656 bytes       0  [emitted]  main
   [0] ./.sapper/main.js 866 bytes {0} [built]

ERROR in ./.sapper/main.js
Module not found: Error: Can't resolve 'C:AppsTestareasveltesappermy-app
untimeapp.js' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'
 @ ./.sapper/main.js 1:0-96

ERROR in ./.sapper/main.js
outelog/[slug].html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'p
 @ ./.sapper/main.js 4:267-376

ERROR in ./.sapper/main.js
outelog/index.html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'pp
 @ ./.sapper/main.js 4:445-552

ERROR in ./.sapper/main.js
outesabout.html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'y-app
 @ ./.sapper/main.js 4:100-197

ERROR in ./.sapper/main.js
outesindex.html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'y-app
 @ ./.sapper/main.js 4:610-703
error Command failed with exit code 1.

output from (5):

$ sapper build
Hash: 55f075cd96ea43dea700
Version: webpack 3.10.0
Time: 202ms
                       Asset       Size  Chunks             Chunk Names
main.55f075cd96ea43dea700.js  656 bytes       0  [emitted]  main
   [0] ./.sapper/main.js 866 bytes {0} [built]

ERROR in ./.sapper/main.js
Module not found: Error: Can't resolve 'C:AppsTestareasveltesappermy-app
untimeapp.js' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'
 @ ./.sapper/main.js 1:0-96

ERROR in ./.sapper/main.js
outelog[slug].html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'pp
 @ ./.sapper/main.js 4:267-376

ERROR in ./.sapper/main.js
outelogindex.html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'app
 @ ./.sapper/main.js 4:445-552

ERROR in ./.sapper/main.js
outesabout.html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'y-app
 @ ./.sapper/main.js 4:100-197

ERROR in ./.sapper/main.js
outesindex.html' in 'C:\Apps\Testarea\svelte\sapper\my-app\.sapper'y-app
 @ ./.sapper/main.js 4:610-703
error Command failed with exit code 1.

@Rich-Harris
Copy link
Member

Ok, I think I have it! Can you try

yarn add https://github.com/sveltejs/sapper#possible-windows-fix-3 && yarn run build

please? You might also need to set emitCss to false in webpack.client.config.js and remove the ExtractTextPlugin (possibly a secondary issue).

I haven't totally got to the bottom of this, but preliminary investigation suggests webpack is to blame. I don't think it likes absolute import paths in Windows.

@tomcon
Copy link
Author

tomcon commented Dec 20, 2017

Looks like you've cracked the main problem! just a tweak required @Rich-Harris

yarn run v1.2.1
warning ..\package.json: No license field
$ sapper build
(9:2) – A11y: <img> element should have an alt attribute
Hash: dacd24bb738217944fd0
Version: webpack 3.10.0
Time: 1140ms
                                Asset       Size  Chunks             Chunk Names
      about.0.dacd24bb738217944fd0.js    5.33 kB       0  [emitted]  about
          _.1.dacd24bb738217944fd0.js  336 bytes       1  [emitted]  _
 blog_index.2.dacd24bb738217944fd0.js  336 bytes       2  [emitted]  blog_index
blog_$slug$.3.dacd24bb738217944fd0.js  336 bytes       3  [emitted]  blog_$slug$
         main.dacd24bb738217944fd0.js    4.08 kB       4  [emitted]  main
   [0] ./.sapper/main.js + 1 modules 5.53 kB {4} [built]
   [1] ./routes/_components/Nav.html 299 bytes {0} [built] [failed] [1 error]
   [2] ./routes/about.html + 2 modules 20.1 kB {0} [built]
   [3] ./routes/blog/[slug].html 299 bytes {3} [built] [failed] [1 error]
   [4] ./routes/blog/index.html 299 bytes {2} [built] [failed] [1 error]
   [5] ./routes/index.html 299 bytes {1} [built] [failed] [1 error]

ERROR in ./routes/index.html
Module build failed: Error: Error: Error: EINVAL: invalid argument, utime 'C:\Users\tc7\AppData\Local\Temp\svelte-1190322880.css'
    at preprocess.then.catch.err (C:\Apps\Testarea\svelte\sapper\my-app\node_modules\svelte-loader\index.js:53:12)
    at <anonymous>
 @ ./.sapper/main.js 4:610-703

ERROR in ./routes/blog/index.html
Module build failed: Error: Error: Error: EINVAL: invalid argument, utime 'C:\Users\tc7\AppData\Local\Temp\svelte-1201441549.css'
    at preprocess.then.catch.err (C:\Apps\Testarea\svelte\sapper\my-app\node_modules\svelte-loader\index.js:53:12)
    at <anonymous>
 @ ./.sapper/main.js 4:445-552

ERROR in ./routes/_components/Nav.html
Module build failed: Error: Error: Error: EINVAL: invalid argument, utime 'C:\Users\tc7\AppData\Local\Temp\svelte-1518064787.css'
    at preprocess.then.catch.err (C:\Apps\Testarea\svelte\sapper\my-app\node_modules\svelte-loader\index.js:53:12)
    at <anonymous>
 @ ./routes/_components/Layout.html 3:0-29
 @ ./routes/about.html
 @ ./.sapper/main.js

ERROR in ./routes/blog/[slug].html
Module build failed: Error: Error: Error: EINVAL: invalid argument, utime 'C:\Users\tc7\AppData\Local\Temp\svelte-2284459081.css'
    at preprocess.then.catch.err (C:\Apps\Testarea\svelte\sapper\my-app\node_modules\svelte-loader\index.js:53:12)
    at <anonymous>
 @ ./.sapper/main.js 4:267-376
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@Rich-Harris
Copy link
Member

Wahoo! The remaining errors are related to the emitCss stuff I think — I've just updated svelte-loader, can you try installing the latest version and seeing if that fixes it? Thanks

@tomcon
Copy link
Author

tomcon commented Dec 20, 2017

so near and yet
: ( @Rich-Harris

npx degit sveltejs/sapper-template my-app
cd my-app
yarn
npm run dev

TODO@0.0.1 dev C:\Apps\Testarea\svelte\sapper\my-app
node server.js

listening on port 3000
webpack built c056ce516e2fd92453a4 in 221ms
(node:6400) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ./.sapper/main.js
Module not found: Error: Can't resolve 'C:AppsTestareasveltesappermy-app
untimeapp.js' in 'C:\Apps\Testarea\svelte\sapper\my-app.sapper'
resolve 'C:AppsTestareasveltesappermy-app
untimeapp.js' in 'C:\Apps\Testarea\svelte\sapper\my-app.sapper'
Parsed request is a module
using description file: C:\Apps\Testarea\svelte\sapper\my-app\package.json (relative path: ./.sapper)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Apps\Testarea\svelte\sapper\my-app\package.json (relative path: ./.sapper)
resolve as module
C:\Apps\Testarea\svelte\sapper\my-app.sapper\node_modules doesn't exist or is not a directory
C:\Apps\Testarea\svelte\sapper\node_modules doesn't exist or is not a directory
C:\Apps\Testarea\svelte\node_modules doesn't exist or is not a directory
C:\Apps\Testarea\node_modules doesn't exist or is not a directory
C:\Apps\node_modules doesn't exist or is not a directory
C:\node_modules doesn't exist or is not a directory
looking for modules in C:\Apps\Testarea\svelte\sapper\my-app\node_modules
using description file: C:\Apps\Testarea\svelte\sapper\my-app\package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Apps\Testarea\svelte\sapper\my-app\package.json (relative path: ./node_modules)
using description file: C:\Apps\Testarea\svelte\sapper\my-app\package.json (relative path: ./node_modules/C:AppsTestareasveltesappermy-app
untimeapp.js)pper
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js.js doesn't exist
.html
Field 'browser' doesn't contain a valid alias configuration
C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js.html doesn't exist
as directory
C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js doesn't exist
[C:\Apps\Testarea\svelte\sapper\my-app.sapper\node_modules]
[C:\Apps\Testarea\svelte\sapper\node_modules]
[C:\Apps\Testarea\svelte\node_modules]
[C:\Apps\Testarea\node_modules]
[C:\Apps\node_modules]
[C:\node_modules]
[C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js]pper
[C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js.js]r
[C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js.html]
[C:\Apps\Testarea\svelte\sapper\my-app\node_modules\C:AppsTestareasveltesappermy-app
untimeapp.js]pper
@ ./.sapper/main.js 1:0-96
(node:6400) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@Rich-Harris
Copy link
Member

I haven't released the fix yet! So starting from scratch with npx degit will blow away the fix in the most recent branch. Bear with me...

@Rich-Harris
Copy link
Member

0.2.3 is released, and I've updated the deps in this repo... fingers crossed 🤞

@tomcon tomcon changed the title hangs on windows 7 - looks like the os path delimiter is not being respected? hangs on windows currently Dec 20, 2017
@Rich-Harris
Copy link
Member

Released 0.2.4 which should also fix the HMR stuff, and a new version of svelte-loader which does the same thing for generated CSS files

@rtorr
Copy link

rtorr commented Dec 21, 2017

Will be testing on holiday. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants