Skip to content
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

JSPM Bundle not right with systemjs-hot-reloader #130

Closed
NickPadilla opened this issue Feb 28, 2017 · 8 comments
Closed

JSPM Bundle not right with systemjs-hot-reloader #130

NickPadilla opened this issue Feb 28, 2017 · 8 comments

Comments

@NickPadilla
Copy link

Hello!

Great work on this project, thanks a heap! When i am doing a jspm bundle base app/base-bundle.js --inject --minify and i try running that build using the original index.html - i get this error in the console.

GET http://localhost:8000/systemjs-hot-reloader 404 (File not found)
N @ fetch.js:32
(anonymous) @ instantiate.js:165

I am just running this using python -m SimpleHTTPServer.

I was under the impression that systemjs-hot-reloader would get written out during the build, or just providing a stub implementation. If i try to add ta map field in the jspm.browser.js to not load systemjs-hot-reloader then i get an error that connect() is not a function.

Is there a way to tell the JSPM build to build for production, thought it was the default, so that i don't have to really edit my index.html for production?

@alexisvincent
Copy link
Owner

@NickPadilla Since systemjs-hot-reloader is never imported by your app, it doesn't get added to the bundle (which is traced from base). To solve just include systemjs-hot-reloader in your bundle. Something like jspm bundle base + systemjs-hot-reloader app/base-bundle.js --inject --minify

@alexisvincent
Copy link
Owner

Closing, if still not working feel free to reopen :)

@cristhian-net
Copy link

@alexisvincent I'm having this problem. I tried with your code without success, because it only bundle to a single file. I'm using v1.1.0. I don't want to modify my code for production either. Any advice? Thanks

@alexisvincent
Copy link
Owner

It's suppose to bundle to a single file though?

@cristhian-net
Copy link

Sorry I just read this today. I thought that this command jspm bundle base + systemjs-hot-reloader app/base-bundle.js --inject --minify will bring the hot-reloader to the bundle (and I think it will do it), but then when this line is called SystemJS.import('systemjs-hot-reloader'), I think that is looking for it outside the bundle because I get GET http://localhost:8000/systemjs-hot-reloader 404 (File not found). But commenting the line importing hot-reloader will make the app work. Sorry if this is not an issue for this package but I found it searching for help with production bundle including systemjs-hot-reloader

@alexisvincent
Copy link
Owner

Hmm, weird. If you do a string search inside your bundle, can you see the systemjs-hot-reloader library? Are you loading the JSPM config? Sorry this took so long, under a lot of work pressure.

@cristhian-net
Copy link

No problem, we are working with the workaround for the time being. I can see the following:

Main\app-bundle.js
systemjs-hot-reloader1

Main\DefaultTabs.aspx
systemjs-hot-reloader2

Chrome DevTools
systemjs-hot-reloader3

jspm.config.js
systemjs-hot-reloader4

@alexisvincent
Copy link
Owner

Is systems-hot-reloader/dist/index.js being injected into the bundle?

I wonder if you aren't perhaps bundling in production mode and then loading it in development mode. Can you try set both to dev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants