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

The id is not given to UMD package. #419

Open
sp1rytus opened this issue Nov 28, 2019 · 2 comments
Open

The id is not given to UMD package. #419

sp1rytus opened this issue Nov 28, 2019 · 2 comments

Comments

@sp1rytus
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[x] Other... Please describe:

Current behavior

Regarding the distributed files of the npm package.

https://www.npmjs.com/package/@ngxs-labs/emitter

node_modules/@ngxs-labs/emitter/bundles/ngxs-labs-emitter.umd.js


(function (global, factory) {| (function (global, factory) {
    typeof exports === 'object' && typeof module! == 'undefined'? factory (exports, require ('@ ngxs / store'), require ('@ angular / core'), require ('rxjs / operators') typeof exports === 'object' && typeof module! == 'undefined'? factory (exports, require ('@ ngxs / store'), require ('$
    typeof define === 'function' && define.amd? define (['exports', '@ ngxs / store', '@ angular / core', 'rxjs / operators'], factory): | typeof define === 'function' && define.amd? define (['exports', '@ ngxs / store', '@ angular / core', 'rxjs / operators'] $
    (global = global || self, factory ((global ['ngxs-labs'] = global ['ngxs-labs'] || {}, global ['ngxs-labs']. emitter = {}), global. ngxs.store, global.ng.core, global.rxjs.operators)); | (global = global || self, factory ((global ['ngxs-labs'] = global ['ngxs-labs'] || { }, global ['ngxs-labs']. emitter = $
} (this, function (exports, store, core, operators) {'use strict';

The ID that recognizes package is not passed when defining with define function. For this reason, the following error occurs when launching a bundled application in Angular with AOT compilation (ngxs-labs-emitter.umd.min.js works correctly)

Current state:


define (['exports', '@ ngxs / store'...

Expected state:


define ('@ngxs-labs/emitter', ['exports', '@ ngxs / store'....

From browser console error:


Uncaught Error: Mismatched anonymous define() module: function (exports, store, core, operators) { 'use strict';

The umd file is created from the github code using the yarn emitter: build command, the ID is correctly assigned, so there may be some problem in the package upload process.

@splincode
Copy link
Member

What is your moduleResolution in tsconfig.json?

@sp1rytus
Copy link
Author

sp1rytus commented Nov 28, 2019

moduleResolution is node

I'm developing ngx app with based on Angular 8.2.14.
We are developing with a template using bazel created with the following command.

ng new --collection=@angular/bazel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants