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 · 1 comment

Comments

@pkozlowski-opensource
Copy link
Member

commented Mar 23, 2017

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

This comment has been minimized.

Copy link
Contributor

commented Mar 23, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.