tc39 / proposal-dynamic-import

import() proposal for JavaScript
https://tc39.github.io/proposal-dynamic-import/
MIT License
1.86k stars 47 forks source link

Error: No NgModule metadata found for 'undefined' for typescript converted js file #49

Closed khaled-ansary closed 7 years ago

khaled-ansary commented 7 years ago

Hi, I am able to load module dynamically using import() method for angular modules in developing mode where I used typescript. i.e. when modules are written in typescript its working fine. Then I tried it in production mode and build all my typescript and generatejs bundle and load it into web server. In that case it is not working and I am getting the following error Error: No NgModule metadata found for 'undefined' to load the module. The scenario where I am getting error is, I developed some plugins with component, module and service, then build the typescript files to get the JS files and import ...module.js file using import() method. In that case, it is not working. But whenever I am using typescript plugins with angular-clithen it works fine. How can I import external JS module by avoiding the mentioned error? Thanks.

aciccarello commented 7 years ago

@khaled-ansary That seems like it is an Angular specific build issue. I would check with the angular-cli team. This repo is to discuss the specification.

domenic commented 7 years ago

Indeed.