Code Monkey home page Code Monkey logo

Comments (15)

hajimehoshi avatar hajimehoshi commented on June 15, 2024

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.

j7b avatar j7b commented on June 15, 2024

Upstream playground fails similarly

from ebiten-playground.github.io.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

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.

j7b avatar j7b commented on June 15, 2024

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.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

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.

j7b avatar j7b commented on June 15, 2024

I got, fixing other issues too.

from ebiten-playground.github.io.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

OK, I'll do tonight. What part are you fixing?

from ebiten-playground.github.io.

j7b avatar j7b commented on June 15, 2024

I fixed and fixed some other stuff will build soon.

from ebiten-playground.github.io.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

https://github.com/j7b/jsplayground is not updated yet. Have you updated that on your local machine?

from ebiten-playground.github.io.

j7b avatar j7b commented on June 15, 2024

Yes will be pushing soon.

from ebiten-playground.github.io.

j7b avatar j7b commented on June 15, 2024

Fixed

from ebiten-playground.github.io.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

👍

https://ebiten-playground.github.io/#/bd945dbd8d2eb52059037e2679bedb0c15efd7f7085b9f3cda8ae6fb495b769a should show error (nil reference) but not. Is this a regression?

from ebiten-playground.github.io.

j7b avatar j7b commented on June 15, 2024

No, I don't think there was a panic handler.

from ebiten-playground.github.io.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

But Go error should be shown on the console, right?

from ebiten-playground.github.io.

hajimehoshi avatar hajimehoshi commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.