-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No UI tree using webpack and ES2015 import #305
Comments
berniezhao
changed the title
No UI running with webpack and ES2015 import
No UI tree using webpack and ES2015 import
Apr 21, 2016
so if you make a module all by itself that includes Bb, Mn and the agent stuff that is the first thing imported, I assume it would work? // agent-shim.js
import Backbone from 'backbone';
import Marionette from 'backbone.marionette';
if (window.__agent) {
window.__agent.start(Backbone, Marionette);
} import './agent-shim';
import Backbone from 'backbone';
import Marionette from 'backbone.marionette';
import Router from './router';
import Layout from './layout';
... ninja-edited a code mistake |
@paulfalgout Yup, this should work. I haven't tested but will try it later. |
@paulfalgout suggestion prevents crashing but Inspector isn't showing any data in my similar case |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using inspector with webpack project and ES2015 "import" statement, the agent failed to patch the application.
Reason being, unlike require() ES2015 import is a static import, webpack will put them in front of any line of code inside the module. Therefore the agent starts too late and failed to patch App.
Webpack compiles the above code into:
The text was updated successfully, but these errors were encountered: