Comments (13)
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 🎉
from turbo-rails.
A temporary way of getting this fix is to update "@hotwired/turbo-rails": "hotwired/turbo-rails#47c7b545"
in your package.json
from turbo-rails.
For context, this is a webpack 4 issue that's supposedly resolved in v5 :
webpack/webpack#10460
abpframework/abp#6283
from turbo-rails.
@nfilzi, your To this version looks good to me. Want to open a PR?
from turbo-rails.
Got the exact same error, haven't found anything relevant so far
from turbo-rails.
@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.
Will do @javan :)
from turbo-rails.
Closed via #26
from turbo-rails.
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.
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.
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.
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.
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)
- turbo_frame_request_id safe operator in not handled correctly HOT 2
- Shouldn't broadcast refresh if streamables == [nil] HOT 1
- @npezza93 ActiveRecord::RecordNotFound in MembersController#edit_description
- FORM with an action URL containing a query param is not submitted. HOT 1
- Mixed Content Error with Turbo Drive
- OT: Attackers might be trying to steal your information from discuss.hotwire.dev HOT 2
- Turbo refresh can hijack user navigation HOT 3
- import "@hotwired/turbo-rails" errors HOT 1
- Using data-turbo-confirm on plain (non-form) buttons HOT 3
- Adding stimulus breaks a test HOT 1
- how do you install turboframes into a rails 5 project that migrated to rails 7 using only sprockets (skipping all the webpack & 6 bs)? HOT 2
- What are the controls effected before injecting `text/vnd.turbo-stream.html`?
- turbo_stream.remove_all Not generating proper selector for targets.
- idiomorph merges attributes on `<turbo-cable-stream-source>` and `connectedCallback()` doesn't run HOT 2
- Add morph to StreamActions HOT 5
- how do I batch multiple turbo stream broadcasts?
- <turbo-cable-stream-source> tag can affect visual layout HOT 1
- broadcast_update_to partial should be smarter and extract the inner_html, it feels like a bug
- Turbo not loading on Safari in production HOT 1
- Any Security Constraints to turbo_method: 'post' functionality?
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 turbo-rails.