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

4.0.0-rc.6 AOT regression: exporting function named toString breaks AoT #15420

Closed
pkozlowski-opensource opened this issue Mar 23, 2017 · 2 comments · Fixed by #15430
Closed
Labels
area: core Issues related to the framework runtime freq3: high regression Indicates than the issue relates to something that worked in a previous version type: bug/fix workaround4: none

Comments

@pkozlowski-opensource
Copy link
Member

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

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

Current behavior

Exporting a function named toString like so breaks AoT with the following error:

0% compilingCould not resolve module 'function toString() { [native code] }' relative to file /Users/pawelkozlowski/work/gitrepos/pkozlowski-opensource/core/src/util/util.ts
10% building modules 3/3 modules 0 activeModuleNotFoundError: Module not found: Error: Can't resolve './../../$$_gendir/demo/src/app/app.module.ngfactory' in '/Users/pawelkozlowski/work/gitrepos/pkozlowski-opensource/core/demo/src'
at factoryCallback (/Users/pawelkozlowski/work/gitrepos/pkozlowski-opensource/core/node_modules/webpack/lib/Compilation.js:230:39)

Expected behavior

Functions named toString are allowed or there is a precise documentation and clear AoT error when a "disallowed" function named is used.

Minimal reproduction of the problem with instructions

This used to work in rc.5 and is linked to the function name (renaming the utility function in question from toString to sth like stringify makes the error go away.

What is the motivation / use case for changing the behavior?

Regression.

Please tell us about your environment:

OSX, node v6.9.5

@DzmitryShylovich
Copy link
Contributor

DzmitryShylovich commented Mar 23, 2017

looks like it was introduced here #15367
module is a function but must be a string
cc @chuckjaz

@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 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime freq3: high regression Indicates than the issue relates to something that worked in a previous version type: bug/fix workaround4: none
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants