You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to use the library as a module in my web page.
If I use "<script type="module" src="https://unpkg.com/rxjs/bundles/rxjs.umd.min.js"></script>"
I get the error:
1st error
Input_0:2259 Uncaught TypeError: Cannot set property 'rxjs' of undefined
at Input_0:2259
at Input_0:2259
If I install the library via npm and then, for testing purposes, use import * as rxjs from "/node_modules/rxjs/_esm2015/index.js";
then I get a list of errors as the following:
2nd error
(some lines excluded)
index.js:47 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/observable/range net::ERR_ABORTED 404 (Not Found)
index.js:48 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/observable/throwError net::ERR_ABORTED 404 (Not Found)
index.js:49 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/observable/timer net::ERR_ABORTED 404 (Not Found)
index.js:50 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/observable/using net::ERR_ABORTED 404 (Not Found)
index.js:51 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/observable/zip net::ERR_ABORTED 404 (Not Found)
index.js:52 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/scheduled/scheduled net::ERR_ABORTED 404 (Not Found)
index.js:55 GET http://localhost:8080/node_modules/rxjs/_esm2015/internal/config net::ERR_ABORTED 404 (Not Found)
localhost/:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
localhost/:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
My explanation for the first error is that rxjs.umd.min.js does not support modules.
My explanation for the second error is, that the file /node_modules/rxjs/_esm2015/index.js references './internal/observable/range' and when the browser requests this file it does not automatically add .js so the file is not found.
I tried adding .js to all imports in _esm2015/index.js, and then these were found but I would have to do this recursively for all subfolders.
Describe the solution you'd like
What I tried, is it already possible and I am just doing something wrong? If not, is there a plan to implement it or are there better alternatives.
Describe alternatives you've considered
(If this is new operator request) describe reason it should be core operator
For projects just using modern browsers I think using import should be the preferred solution
Additional context
I used Chrome browser and http-server.
The text was updated successfully, but these errors were encountered:
Feature Request
Maybe this is already possible.
Is your feature request related to a problem? Please describe.
I want to use the library as a module in my web page.
If I use "<script type="module" src="https://unpkg.com/rxjs/bundles/rxjs.umd.min.js"></script>"
I get the error:
1st error
If I install the library via npm and then, for testing purposes, use
import * as rxjs from "/node_modules/rxjs/_esm2015/index.js";
then I get a list of errors as the following:
2nd error
My explanation for the first error is that rxjs.umd.min.js does not support modules.
My explanation for the second error is, that the file /node_modules/rxjs/_esm2015/index.js references './internal/observable/range' and when the browser requests this file it does not automatically add .js so the file is not found.
I tried adding .js to all imports in _esm2015/index.js, and then these were found but I would have to do this recursively for all subfolders.
Describe the solution you'd like
What I tried, is it already possible and I am just doing something wrong? If not, is there a plan to implement it or are there better alternatives.
Describe alternatives you've considered
(If this is new operator request) describe reason it should be core operator
For projects just using modern browsers I think using import should be the preferred solution
Additional context
I used Chrome browser and http-server.
The text was updated successfully, but these errors were encountered: