Comments (14)
Not sure if this is the right place for this, but on WSL2 (Ubuntu 18.04) my Svelte/Snowpack project never gets past the first build.
Site seems to work still, but any file changes do not rebuild or refresh the browser.
That's an ongoing issue with WSL2 that is affecting all file watchers currently for files in /mnt/c
If you move the files inside the Linux file system (I moved them to a folder inside ~) the watchers work correctly and as an added bonus you get amazing file i/o performance.
If you don't feel like copying files around on the shell, you can open Windows explorer inside the Linux filesystem by calling the exe directly an passing it a folder path. Example: explorer.exe .
for the current folder.
from create-snowpack-app.
npx create-snowpack-app mydir --template @snowpack/app-template-svelte
is also failing for me on Windows 10 WSL Ubuntu and also Windows 10 Powershell, producing a similar error to the above:
(node:344) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/mnt/c/dev/mydir/node_modules/@snowpack/app-template-svelte'
It's weird that it produces the exact same result on WSL and Powershell.
from create-snowpack-app.
So strange, it definitely seems to be an issue creating this path: C:\home\new-dir.build_dist_\index.js
But the line where that happens is (simplified):
const a = path.join(cwd, `.build`)
const b = path.join(a, '/_dist_');
When I play around with this using path.win32.join
, it seems fine. Unfortunately I don't have a windows machine. Any ideas what could be happening?
from create-snowpack-app.
Could it be the leading /
in /_dist_
? Windows uses \
as a separator, which I think is the main thing path.join
is there to solve. I think a link to the real code you simplified might also help.
from create-snowpack-app.
There seem to be 2 build folders. Also the _dist_
is missing:
from create-snowpack-app.
oh that helps! ".build" is the unbundled site that we the run Parcel on to create the final "build" dir. "dist/" missing seems to be the bigger issue here, which would also be caused by the issue mentioned above.
@AsaAyers it could be the extra "/" but I just tried that with path.win32.join and it handled it fine. That makes me think it's something else, but if you were able to make a quick change and test it locally on your windows machine so that we could confirm, that would be great:
// build.ts
- const distDirectoryLoc = path.join(buildDirectoryLoc, config.devOptions.dist);
+ const distDirectoryLoc = path.join(buildDirectoryLoc, config.devOptions.dist.substr(1));
from create-snowpack-app.
It doesn't appear to make any difference. I believe this is the line you're referring to
Whether I have the .substr(1)
or not, they both create the same result:
C:\Users\Asa\Documents\GitHub\snow-worker\.build\_dist_
(no substr)
C:\Users\Asa\Documents\GitHub\snow-worker\.build\_dist_
(.substr(1))
I can also confirm that .build/_dist_
doesn't exist.
I didn't want to go through the whole process of trying to build snowpack
myself, so I actually just edited node_modules\snowpack\dist-node\index.js
.
from create-snowpack-app.
It's not clear to me if this is a different issue (if it is, let me know and I'll create a separate one), but a similar but slightly different problem with the react-typescript template:
npx create-snowpack-app new-dir --template @snowpack/app-template-react-typescript --use-yarn
cd new-dir
yarn build
results in this error (which is slightly different than the svelte error message):
Snowpack
.\build Building your application...
mount:public............[DONE]
mount:web_modules.......[DONE]
mount:src...............[DONE]
lintall:tsc.............[DONE]
build:ts,tsx,js,jsx.....[DONE]
build:css...............[DONE]
build:svg...............[DONE]
bundle:*................[FAILED]
▼ bundle:*
× No entries found.
at Bundler.bundle (D:\EpicSource\new-dir\node_modules\parcel-bundler\src\Bundler.js:275:17)
Error: Command failed with exit code 1: parcel build index.html --out-dir D:\EpicSource\new-dir\build
× No entries found.
at Bundler.bundle (D:\EpicSource\new-dir\node_modules\parcel-bundler\src\Bundler.js:275:17)
▼ Result
⚠️ Finished, with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
After the crash, there is a .build/ folder that contains only package.json and an empty build/ folder.
Note, that template works fine on ubuntu 18.04, so in this case it does seem to be Windows specific.
from create-snowpack-app.
See my linked pull request. I debugged tonight and found that build.ts was using glob.sync() to find files and then doing .replace() on the returned file paths using folder paths that came from path.resolve()
glob.sync() returns c:/paths/that/look/like/this on windows and path.resolve() returns c:\paths\that\look\like\this. So the attempt to replace -style paths in the string that had /-style paths was not doing anything and the various copy operations in build.ts were copying the file on top of itself instead if into the .build folder.
I tested this with both the react template and with the svelte templates. Both work now. Note, however, when I tried the svelte template without the fix I was getting a No entries found
error and not a ENOENT
error as originally reported.
from create-snowpack-app.
THANK YOU! Really appreciate the help debugging on Windows 👍👍👍
With this PR I can do some work to add a basic test suite to make sure that we don't regress on Windows, or if we do that it's obvious which PR/commit did it.
I can't believe that glob returns bad files on Windows, that seems like a huge miss
from create-snowpack-app.
I was surprised too, but it looks like it was intentional based on https://github.com/isaacs/node-glob#user-content-windows
from create-snowpack-app.
huh, that's... suprising. Someone else suggested updating to use globby, might be worth pulling the trigger on that if there are other issues like this lurking
from create-snowpack-app.
from create-snowpack-app.
Not sure if this is the right place for this, but on WSL2 (Ubuntu 18.04) my Svelte/Snowpack project never gets past the first build.
mount:web_modules [DONE]
mount:public [DONE]
mount:src [DONE]
build:.js,.jsx,.ts,.tsx. [READY]
build:svelte [READY]
Site seems to work still, but any file changes do not rebuild or refresh the browser.
from create-snowpack-app.
Related Issues (20)
- Babel Plugin import not working with snowpack HOT 1
- [webpack] Support non-SPA use-case HOT 1
- [plugin-webpack] Not compatible with [app-template-vue] HOT 1
- [plugin-webpack] Production builds: No bundle splitting based on `import(...)` directives HOT 9
- [plugin-svelte] Can not find App.css.js HOT 3
- Provide a blank template for Typescript HOT 4
- Feature request: Add pnpm as install option HOT 5
- Building is broken for Svelte HOT 5
- Add support for creating .gitignore from template HOT 5
- Can we have cli wizard prompts? HOT 6
- @snowpack/app-template-blank-typescript does not exist on NPM HOT 5
- onboard validations to ensure that the respective package manager is installed HOT 4
- plugin-dotenv doesn't work HOT 2
- [plugin-webpack] granular chunking for multi-page apps?
- [@snowpack/app-template-11ty] - HMR issue eleventy templates HOT 1
- Migrating Reactboilerplate app into CSA failing HOT 2
- [@snowpack/plugin-webpack] Use public path instead of baseUrl HOT 1
- [pnpm] missing dependencies in app-template-react-typescript (--use-pnpm) HOT 2
- svelte-typescript-template HOT 1
- Vue cannot use PostCSS in style tag. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-snowpack-app.