Giter Site home page Giter Site logo

Comments (13)

nfilzi avatar nfilzi commented on August 10, 2024 9

Found sth in the end 🎉
According to this SO answer, apparently you can't export directly all exposed properties from another module. You need to import them first, then export them again.

Excuse me for any potential lack of clarity with my explanations, my JS bundling knowledge is ultra flaky 🙈 😁

In the end, changing turborails/javascript/turbo/index.js from this:

import "./cable_stream_source_element"
export * as Turbo from "@hotwired/turbo"
export * as cable from "./cable"

To this

import "./cable_stream_source_element"

import * as Turbo from "@hotwired/turbo"
export { Turbo }

import * as cable from "./cable"
export { cable }

Did the trick for me locally 🎉
Screenshot 2020-12-24 at 03 34 51

from turbo-rails.

udkl avatar udkl commented on August 10, 2024 5

A temporary way of getting this fix is to update "@hotwired/turbo-rails": "hotwired/turbo-rails#47c7b545" in your package.json

from turbo-rails.

udkl avatar udkl commented on August 10, 2024 3

For context, this is a webpack 4 issue that's supposedly resolved in v5 :
webpack/webpack#10460
abpframework/abp#6283

from turbo-rails.

javan avatar javan commented on August 10, 2024 1

@nfilzi, your To this version looks good to me. Want to open a PR?

from turbo-rails.

nfilzi avatar nfilzi commented on August 10, 2024

Got the exact same error, haven't found anything relevant so far

from turbo-rails.

nfilzi avatar nfilzi commented on August 10, 2024

@javan Anything we may have overlooked?

My findings fix the issue, but I'm wondering if it could be linked in the first place to sth peculiar in our dev setup locally? (node or webpack version, missing sth / sth extra in our webpack / babel config)?

from turbo-rails.

nfilzi avatar nfilzi commented on August 10, 2024

Will do @javan :)

from turbo-rails.

javan avatar javan commented on August 10, 2024

Closed via #26

from turbo-rails.

ryw avatar ryw commented on August 10, 2024

A temporary way of getting this fix is to update "@hotwired/turbo-rails": "hotwired/turbo-rails#47c7b545" in your package.json

Attempted this, now I get another js error TypeError: Attempting to change the getter of an unconfigurable property. on Line 35 of turbo.source.js:

  Object.defineProperty(Event.prototype, "submitter", {

from turbo-rails.

ryw avatar ryw commented on August 10, 2024

Hmm tried to upgrade webpacker to 5.2.1, and switched package.json back to the standard entry and I get same error, so maybe a different issue

from turbo-rails.

arpansac avatar arpansac commented on August 10, 2024

Earlier installed and then removed stimulus_reflex.
Spent hours figuring out why my link_to inside a turbo frame was taking me to a different page. Finally, had to remove the javascript_pack_tag
Already have webpack 5.2.1
It doesn't display any error though, but the link_to inside turbo frame always tends to open the link in a new page instead of doing it inside the frame

from turbo-rails.

christos avatar christos commented on August 10, 2024

Attempted this, now I get another js error TypeError: Attempting to change the getter of an unconfigurable property. on Line 35 of turbo.source.js:

@ryw Although I have yet to manage to load Turbo successfully in the console, I did manage to get rid of that error. It was caused by having both <%= stimulus_include_tags %> and <%= turbo_include_tags %> in application.html.erb. I think it was basically trying to load an already loaded module and hence the error.

from turbo-rails.

goulvench avatar goulvench commented on August 10, 2024

In my case this error was fixed by replacing <%= javascript_packs_with_chunks_tag %> with <%= javascript_pack_tag %>. Getting rid of Webpack is next on the list :-)

from turbo-rails.

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.