Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Routes clash error in dev server when editing file from sveltejs/sapper-template degit app #220

Closed
btakita opened this issue Mar 30, 2018 · 3 comments · Fixed by #410
Closed

Comments

@btakita
Copy link
Contributor

btakita commented Mar 30, 2018

Run:

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

Then edit routes/index.html

Error: The index.html and index.html___jb_tmp___ routes clash
    at /home/user/my-app/node_modules/sapper/dist/core.ts.js:204:15
    at Array.sort (native)
    at Object.create_routes (/home/user/my-app/node_modules/sapper/dist/core.ts.js:172:10)
    at FSWatcher.<anonymous> (/home/user/my-app/node_modules/sapper/dist/dev.ts.js:164:51)
    at FSWatcher.emit (events.js:180:13)
    at FSWatcher.<anonymous> (/home/user/my-app/node_modules/chokidar/index.js:199:15)
    at FSWatcher._emit (/home/user/my-app/node_modules/chokidar/index.js:241:5)
    at FSWatcher.NodeFsHandler._handleFile (/home/user/my-app/node_modules/chokidar/lib/nodefs-handler.js:276:10)
    at FSWatcher.<anonymous> (/home/user/my-app/node_modules/chokidar/lib/nodefs-handler.js:474:21)
    at FSReqWrap.oncomplete (fs.js:171:5)

As you can see above, I ran npm-check-updates.
Here is my package.json:

{
  "name": "TODO",
  "description": "TODO",
  "version": "0.0.1",
  "scripts": {
    "dev": "sapper dev",
    "build": "sapper build",
    "export": "sapper export",
    "start": "sapper start",
    "cy:run": "cypress run",
    "cy:open": "cypress open",
    "test": "run-p --race dev cy:run"
  },
  "dependencies": {
    "compression": "^1.7.2",
    "npm-run-all": "^4.1.2",
    "polka": "^0.3.4",
    "sapper": "^0.10.2",
    "serve-static": "^1.13.2",
    "svelte": "^1.58.5",
    "svelte-loader": "^2.5.1",
    "webpack": "^4.4.1"
  }
}
@btakita
Copy link
Contributor Author

btakita commented Mar 30, 2018

#217

@btakita
Copy link
Contributor Author

btakita commented Mar 30, 2018

I'm using Webstorm, & it looks like Jetbrains IDEs create a temporary file on update:

index.html___jb_tmp___

In this case, I would have to disable "Safe Write".

https://stackoverflow.com/questions/23864827/jb-bak-and-jb-old-files-in-pycharm#27449850

Of course, it would be great to have this issue fixed on the sapper side.

@Rich-Harris
Copy link
Member

Thanks — in 0.19.2, files with extensions that aren't just [a-z]+ are ignored, preventing these kinds of clashes

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.

2 participants