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

ES5 testing bundles contain ES2015 codes #14730

Closed
log2-hwan opened this issue Feb 25, 2017 · 6 comments · Fixed by #14820
Closed

ES5 testing bundles contain ES2015 codes #14730

log2-hwan opened this issue Feb 25, 2017 · 6 comments · Fixed by #14820
Labels
area: packaging Issues related to Angular's creation of npm packages regression Indicates than the issue relates to something that worked in a previous version type: bug/fix

Comments

@log2-hwan
Copy link

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting

Current behavior
ES5 testing bundle files(testing.es5.js) contain ES2015 codes.

Expected behavior
testing.es5.js files contain transpiled ES5 codes.

  • Angular version: 4.0.0-rc.1
  • Language:: Typescript 2.1.6
@wesleycho
Copy link
Contributor

wesleycho commented Feb 25, 2017

To give more useful information, I am seeing this error in tests

25 02 2017 05:28:23.601:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket _2cnmwANx86QAZZZAAAA with id 80543945
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  SyntaxError: Unexpected token 'const'
  at webpack:///~/@angular/core/@angular/core/testing.es5.js:10:0 <- karma-shim.js:11349

Possibly related, I also see this particular message when running my Webpack build

WARNING in ./~/@angular/core/@angular/core.es5.js 3705:332-415 Critical dependency: the request of a dependency is an expression

I suspect that whatever build process is generating these .es5 files is not doing the appropriate compilation from ES6 to ES5.

@IgorMinar IgorMinar added this to the 4.0.0 milestone Feb 28, 2017
@IgorMinar IgorMinar added area: packaging Issues related to Angular's creation of npm packages regression Indicates than the issue relates to something that worked in a previous version type: bug/fix labels Feb 28, 2017
@csentis
Copy link

csentis commented Feb 28, 2017

@wesleycho re the warning...

WARNING in ./~/@angular/core/@angular/core.es5.js 3705:332-415 Critical dependency: the request of a dependency is an expression

... you can, thanks to @Martin-Wegner, find a solution in #11580:

new webpack.ContextReplacementPlugin(
  /angular(\\|\/)core(\\|\/)@angular/,
  path.resolve(__dirname, '../src')
)

Use the snippet above to replace what was common before (up until 4.0.0-beta.8):

new webpack.ContextReplacementPlugin(
  /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
  path.resolve(__dirname, '../src')
)

@DjolePetrovic
Copy link

If you use angular cli, you are out of luck? Or can you still use this snippet somehow?

@stevermeister
Copy link
Contributor

@csentis the snippet did not help to solve the actual issue

@csentis
Copy link

csentis commented Feb 28, 2017

@DjolePetrovic I have no experience with an angular-cli-based setup. As far as I have learned, angular-cli hides the webpack config which is exactly the place where you would put the snippet I referenced above - which is why I assume: out of luck. Someone here who could please contribute hard facts instead of my assumptions?

@stevermeister true - as originally stated, the snippet targets the part of the "critical dependency" warning only.

jasonaden added a commit to jasonaden/angular that referenced this issue Mar 1, 2017
Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
jasonaden added a commit to jasonaden/angular that referenced this issue Mar 1, 2017
Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
jasonaden added a commit to jasonaden/angular that referenced this issue Mar 1, 2017
Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
matsko pushed a commit to matsko/angular that referenced this issue Mar 1, 2017
Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
IgorMinar pushed a commit that referenced this issue Mar 1, 2017
…14820)

Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes #14730
Ionaru added a commit to Ionaru/EVIE that referenced this issue Mar 3, 2017
Ionaru added a commit to Ionaru/EVIE that referenced this issue Mar 3, 2017
* Upgraded Angular to 4.0.0-rc1 and CLI to 1.0.0-rc1

* Karma configuration is now a Typescript file

* Switched from Jasmine to Mocha in client-side tests

* Updated server-side tests with Chai

* Removed ng2-translate since I'm not using it at this point

* Passwords are now hashed and encoded before being sent to the server, this is done to ensure passwords are always within the ~50-bytes lower limit of bcrypt. In addition it is now very difficult for network sniffers to determine what the user typed in the password field.

* Temporarily disable Saucelabs testing until angular/angular#14730 is fixed
SamVerschueren pushed a commit to SamVerschueren/angular that referenced this issue Mar 18, 2017
…ngular#14820)

Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
…ngular#14820)

Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
…ngular#14820)

Secondary entry points (testing, static, etc) are rolled up into a
single ESM/ES2015 file, then downleveled to ESM/ES2015. This downleveling
was not working and was producing ESM/ES2015. Also, the @angular/core
package's .babelrc file was missing reference to Rx Observable which
broke the UMD bundle.

Fixes angular#14730
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: packaging Issues related to Angular's creation of npm packages regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants