Coder Social home page Coder Social logo

canvaskit.js:97 Uncaught SyntaxError: Unexpected token ')' (at canvaskit.js:97:504) while using local canvaskit about flutter HOT 3 OPEN

nimashahahmadian avatar nimashahahmadian commented on May 18, 2024
canvaskit.js:97 Uncaught SyntaxError: Unexpected token ')' (at canvaskit.js:97:504) while using local canvaskit

from flutter.

Comments (3)

huycozy avatar huycozy commented on May 18, 2024

Hi @nimashahahmadian
I can't reproduce the issue on my end. The built web can run normally without error above. Could you share your sample code so I can try it? And which browser are you using?

from flutter.

nimashahahmadian avatar nimashahahmadian commented on May 18, 2024

My sample code is flutter's original start project.
the way to reproduce it is using build with the following commands:

flutter build web --no-web-resources-cdn --web-renderer canvaskit

I tried serving the build with local npm serve method and with apache on a remote server.
when serving local with npm serve. some errors happen which I can not understand what it is but the app works through to my login page.

on remote server app won't even start.
and crash with mentioned logs and errors.

what is the best practice to serve flutter web app using canvaskit build and not using any cdn?

from flutter.

huycozy avatar huycozy commented on May 18, 2024

I hosted the build in local with Python, it works as expected:

Screenshot 2024-05-07 at 11 55 38

when serving local with npm serve. some errors happen which I can not understand what it is but the app works through to my login page.

It seems you are testing your production project. Please retry on a new Flutter project.

Could you try switching to Network tab on your browser and check the request URLs as in my screenshot?

from flutter.

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.