emitter icon indicating copy to clipboard operation
emitter copied to clipboard

The id is not given to UMD package.

Open sp1rytus opened this issue 5 years ago • 2 comments

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.

sp1rytus avatar Nov 28 '19 06:11 sp1rytus

What is your moduleResolution in tsconfig.json?

splincode avatar Nov 28 '19 06:11 splincode

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

sp1rytus avatar Nov 28 '19 08:11 sp1rytus