Comments (15)
It looks like imported path is solved at g.importContext.Import and the panic happens just after compiling github.com/hajimehoshi/ebiten
and before compiling image
. I think using goroutines introduced unexpected behavior. This should be related to j7b/jsplayground#2 .
from ebiten-playground.github.io.
Upstream playground fails similarly
from ebiten-playground.github.io.
OK so the problem is in playground.js.
I investigated other usages of compiler.ImportDependencie
like https://github.com/gopherjs/gopherjs/blob/master/build/build.go. The given unnamed function calls buildImportPathWithSrcDir
, that calls BuildPackage
, that calls buildImportPathWithSrcDir
for each imported package recursively. Thus, I think g.importContext.Import
should do the same recursive thing instead of reading only one package. We would be able to keep goroutines in Import
, but I think we should remove that not to introduce another unexpected behavior in the future.
from ebiten-playground.github.io.
It can't really do that asynchronously without doing a lot of inspection that gets kind of complicated.
A four line change to jsplayground that fixes it is to compile twice if any packages were fetched if err != nil which I think is intended in upstream's approach but fails in cases like this where the package is resolved but too late for another dependency. You'll note the 2nd time you press run it compiles.
from ebiten-playground.github.io.
You'll note the 2nd time you press run it compiles.
Yeah, that's true. I printf-ed at the import function and found how importing worked.
If you are busy, shall I fix this?
from ebiten-playground.github.io.
I got, fixing other issues too.
from ebiten-playground.github.io.
OK, I'll do tonight. What part are you fixing?
from ebiten-playground.github.io.
I fixed and fixed some other stuff will build soon.
from ebiten-playground.github.io.
https://github.com/j7b/jsplayground is not updated yet. Have you updated that on your local machine?
from ebiten-playground.github.io.
Yes will be pushing soon.
from ebiten-playground.github.io.
Fixed
from ebiten-playground.github.io.
👍
https://ebiten-playground.github.io/#/bd945dbd8d2eb52059037e2679bedb0c15efd7f7085b9f3cda8ae6fb495b769a should show error (nil reference) but not. Is this a regression?
from ebiten-playground.github.io.
No, I don't think there was a panic handler.
from ebiten-playground.github.io.
But Go error should be shown on the console, right?
from ebiten-playground.github.io.
But Go error should be shown on the console, right?
Ah sorry the original state didn't handle such Go errors. Please ignore this.
Thank you for fixing.
from ebiten-playground.github.io.
Related Issues (20)
- License HOT 1
- Where is the original Go source for jsplayground.js? HOT 3
- Assets HOT 5
- Suggestion: Managing only a diff part of the GopherJS playground HOT 4
- Suggestion: Move pkg to another git repository or storage HOT 8
- Enable to select backend storage
- Use sandbox attribute for iframe HOT 4
- Use different subdomains for different snippets HOT 1
- Indentation HOT 2
- Error handling when posting HOT 1
- Is the text size changer really needed? HOT 1
- Cache compiled javascript HOT 1
- Improve editor interface HOT 1
- Improve the default script HOT 8
- Compiling in workers
- Handle panic in Go execusion
- Better 'about' explanation HOT 1
- Shareable link should be shown next to 'Share' button
- Question: how to generate js files HOT 3
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 ebiten-playground.github.io.