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

--js-compile --js-minify --html-minify make jQuery crash #2382

Open
baocang opened this issue Mar 27, 2017 · 11 comments
Open

--js-compile --js-minify --html-minify make jQuery crash #2382

baocang opened this issue Mar 27, 2017 · 11 comments

Comments

@baocang
Copy link
Contributor

baocang commented Mar 27, 2017

Description

Versions & Environment

  • Polymer: 2.0.0-rc.3
  • Polymer CLI: 0.18.0-pre.15
  • node: v7.7.3
  • webcomponentsjs: 1.0.0-rc.7
  • Operating System: macOS Sierra Version 10.12.3

Steps to Reproduce

  1. Create an application project: polymer init polymer-2-application
  2. Add script tag to src/app-shell/app-shell.html <script src="jquery-3.2.0.js"></script>
  3. Update webcomponentsjs in bower.json to #1.0.0-rc.7
  4. Update bower components: bower update
  5. Build: polymer build --entrypoint index.html --shell src/app-shell/app-shell.html --bundle --js-compile --js-minify --html-minify
  6. Serve: polymer serve build/default
  7. Open in chrome: http://127.0.0.1:8000

Expected Results

No error is throw

Actual Results

Error is thrown

error

@baocang
Copy link
Contributor Author

baocang commented Mar 27, 2017

image

@web-padawan
Copy link
Contributor

Might be related to babel/babel#340

BTW, why to use jQuery with Polymer? You might not need it at all, and take into account that in case of DOM manipulations, jQuery is not aware of Shadow DOM.

@baocang
Copy link
Contributor Author

baocang commented Mar 27, 2017

I'm trying to build a SaaS application wtihout jQuery, But some thirdpart library not sure. such as: http://www.highcharts.com, https://www.mobiscroll.com 😪.

@FredKSchott
Copy link
Contributor

@baocang Can you try each of those flags individually, to see which is causing the issue? My guess is it's just --js-compile but it could also be --js-minify.

We have a task to add the ability to whitelist files to be skipped for processing. If some popular files are currently broken we should bump up the priority.

@baocang
Copy link
Contributor Author

baocang commented Mar 29, 2017

@FredKSchott --bundle --js-minify.

@baocang
Copy link
Contributor Author

baocang commented Mar 29, 2017

@FredKSchott polymer build --js-minify with no error in console. but the code \x20 has already translated to unicode char.

@FredKSchott
Copy link
Contributor

Okay, thanks for responding with that info. I'll look into this when I can prioritize the time.

@FredKSchott FredKSchott self-assigned this Apr 11, 2017
@jogibear9988
Copy link

Any news to this?

@christophe-g
Copy link
Contributor

For the time being - submitted a PR to skip problematic js files here : Polymer/polymer-cli#878.

Try it out by adding jQuery in the list of files to skip.

@jogibear9988
Copy link

this is now fixed in my babel minfy patch: babel/minify#733

I put a suggestion how to use while babel minify is not updated (and polymer cli also not) here: https://github.com/Polymer/polymer-cli/issues/886

@stale
Copy link

stale bot commented Mar 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants