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

rxjs Warnings - Unresolved dependencies / Missing global variable names #1642

Closed
dgroh opened this issue Sep 19, 2017 · 2 comments
Closed

rxjs Warnings - Unresolved dependencies / Missing global variable names #1642

dgroh opened this issue Sep 19, 2017 · 2 comments

Comments

@dgroh
Copy link

dgroh commented Sep 19, 2017

I'm creating a node package for Angular 4.4.1 with TypeScript

That is my rollup.config.js

import resolve from 'rollup-plugin-node-resolve';

export default {
	input: 'dist/dnn.js',
	output: {
		file: 'dist/bundles/dnn.umd.js',
		format: 'umd'
	},
	sourceMap: false,
	name: 'dnn',
	plugins: [
		resolve({
			module: true,
			jsnext: true,
			main: true,
			modulesOnly: true,
		})
	]
}

I get the following warning:

dist/dnn.js → dist/bundles/dnn.umd.js...

(!) Unresolved dependencies
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
rxjs/Observable (imported by node_modules\@angular\core\@angular\core.es5.js, node_modules\@angular\common\@angular\common\http.es5.js)
rxjs/observable/merge (imported by node_modules\@angular\core\@angular\core.es5.js)
rxjs/operator/share (imported by node_modules\@angular\core\@angular\core.es5.js)
rxjs/Subject (imported by node_modules\@angular\core\@angular\core.es5.js)
rxjs/observable/of (imported by node_modules\@angular\common\@angular\common\http.es5.js)
rxjs/operator/concatMap (imported by node_modules\@angular\common\@angular\common\http.es5.js)
rxjs/operator/filter (imported by node_modules\@angular\common\@angular\common\http.es5.js)
rxjs/operator/map (imported by node_modules\@angular\common\@angular\common\http.es5.js)

(!) Missing global variable names
Use options.globals to specify browser global variable names corresponding to external modules
rxjs/Observable (guessing 'Observable')
rxjs/observable/merge (guessing 'merge')
rxjs/operator/share (guessing 'share')
rxjs/Subject (guessing 'Subject')
rxjs/observable/of (guessing 'of')
rxjs/operator/concatMap (guessing 'concatMap')
rxjs/operator/filter (guessing 'filter')
rxjs/operator/map (guessing 'map')

why is this only happening for rxjs? @angular/core and @angular/common passed without any problems.

@lukastaegert
Copy link
Member

Hi,

using modulesOnly behaves exactly as expected when it warns you that the listed npm libraries do not use the ES6 format and are in fact ignored. This option is meant as a way to determine if you still have commonjs libraries in your dependencies that require special treatment via rollup-plugin-commonjs. Your code will probably not work since the listed dependencies will be missing. You should remove modulesOnly and instead add rollup-plugin-commonjs.

@lukastaegert
Copy link
Member

Closing this as there has been no further comment for quite some time.

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