Closed Mista-T closed 3 years ago
@Mista-T did you try refreshing and did you run them at the root of the react folder in examples folder.
Hi Ameer, thanks for getting back to me!
Yes, I did run blazepack inside either the "examples/vanilla/" or the "examples/react/" folders, the ones containing the package.json files.
Blazepack starts up fine in the terminal, but in the browser I only get a blank screen and the given error above.
Refreshing didn't help either.
Here's a console output, the warnings are only sandbox source maps though.
Maybe it has to do with a mixed up initialization call on the Sandbox PreviewManager()? It expects the following set of attributes: "(selector, sandboxInfo, options)", but gets supplied: "('#root', { showOpenInCodeSandbox: false })". So I guess the second supplied argument should be the options, but as there are only two given, the PreviewManager doesn't have the correct "sandboxInfo" or mixes that up with the supplied "options"? It does call it's internal function "createMissingPackageJSON(...)" later, which throws the error. Maybe that helps. Cheers!
@Mista-T got it can you try with latest version?
@ameerthehacker I don't see a newer version yet, sorry.
Re-checked again with blazepack@0.0.13 and the same error is being thrown, sorry. Edit: I updated the example folders a la v0.0.13 and now the react example shows up, but subsequent file changes are not being watched or reloaded. The vanilla example still throws the same error.
can you try it on a fresh create react app?
Hi Ameer, I tried again with a freshly globally installed blazepack v0.0.15. Created a new react template project in an empty folder:
[XY:path user$ blazepack start cra --template=react
Downloading the template react...
⚡ Blazepack dev server running at http://localhost:3000
Unhandled Sandpack error while running the app.
No dependencies specified, please specify either a package.json or dependencies.
Terminating the server
Same error when I manually change into the newly created project folder ("cra" in my case above) and start blazepack from there.
I'm short on time right now, but hope to be able to dig into code a bit later and maybe could help out here. Cheers!
@Mista-T this seems weird which os are you using?
I'm (still) on macOS Mojave, v10.14.4 Using Node v12.13.0 in the terminal.
I tried the same command and it works for me. Though I tried it with npx
but it should work with global setup as well. Are you seeing the created directory with the name cra
?
Same is happening with me too...
$ blazepack --version
#output: v0.0.16
$ node -v : v14.15.4
$ npm -v : 7.5.2
$ npx -v : 7.5.2
Another attempt:
But it was working fine yesterday :(
Any possible problems/debugging thing i can try..?
Can you verify that you have package.json and in that you have dependencies and main
field ?
If not try adding main
field in package.json
Can you verify that you have package.json and in that you have dependencies and
main
field ?If not try adding
main
field in package.json
Sure,
Ok got it working, I guess its realted to my earlier directory only, but in other places it works great!!
@Mista-T , can you try running blazepack creat command somewhere else than your earlier directory ..?
@Mista-T closing this, feel free to reopen if you are still facing the issues.
Hi guys, sorry for being off for a few days, here's what happened after I tried with the latest blazepack version (v0.0.17) and a fresh, empty directory on my machine:
CT:blazepack-test user$ blazepack create cra --template=react
Downloading the template react...
CT:blazepack-test user$ cd cra/
CT:cra user$ blazepack
⚡ Blazepack dev server running at http://localhost:3000
Unhandled Sandpack error while running the app.
Cannot read property 'code' of undefined
Terminating the server
Hi guys, sorry for being off for a few days, here's what happened after I tried with the latest blazepack version (v0.0.17) and a fresh, empty directory on my machine:
CT:blazepack-test user$ blazepack create cra --template=react Downloading the template react... CT:blazepack-test user$ cd cra/ CT:cra user$ blazepack ⚡ Blazepack dev server running at http://localhost:3000 Unhandled Sandpack error while running the app. Cannot read property 'code' of undefined Terminating the server
So, that means this is still a issue..?
For me trying in different directory just solved the issue.
Can you tell what node, npm version you are using?
mine is:
$ blazepack --version
#output: v0.0.16
$ node -v : v14.15.4
$ npm -v : 7.5.2
$ npx -v : 7.5.2
Sure thing, thanks for sticking with me!
$ blazepack --version : v0.0.17
$ node -v : v12.13.0
$ npm -v : 6.14.5
$ npx -v : 6.14.5
I will try again with an updated node version (v14) too later.
Sorry guys, it just doesn't work (on my machine):
I updated to the latest LTS node v14.15.5 and then:
$ npx blazepack create cra --template=react
npx: Installed 74 in 3.617s
Downloading the template react...
$ cd cra
$ npx blazepack
⚡ Blazepack dev server running at http://localhost:3000
Unhandled Sandpack error while running the app.
Cannot read property 'code' of undefined
Terminating the server
The create method downloads and installs a new react project just fine, package.json, public and src folders with the respective files are being created correctly. Sandpack doesn't seem to like something on my machine...
I'll grab the source code later and see if I can find something locally...
hey give it a try by hard reload and also by trying it in incognito
@Mista-T if you were running on a linux machine, we just released a bug fix for that, do try out the latest version and let me know if you still face any issues
First up, this is great work and looks very promising, so thanks a lot!
I bet it's just a usage error on my part, but when I try to run "blazepack" or "npx blazepack" (doesn't make a difference) locally inside your provided example folders (either "react" or "vanilla"), I get the same following error: "Uncaught Error: No dependencies specified, please specify either a package.json or dependencies."
What am I missing? :-)
Thanks Ameer!