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

Usage via CDN #675

Closed
andersstorhaug opened this issue Jan 13, 2022 · 3 comments
Closed

Usage via CDN #675

andersstorhaug opened this issue Jan 13, 2022 · 3 comments

Comments

@andersstorhaug
Copy link

andersstorhaug commented Jan 13, 2022

Hi there,

The following contrived example produces this error: Uncaught TypeError: Failed to resolve module specifier "tslib". Relative references must start with either "/", "./", or "../"..

<script type="module">
    import { SourceCache } from "https://cdn.skypack.dev/dynamicdatajs@beta";
</script>

I've spent some time trying to understand what the issue is here, and, it may in fact be coming from the Skypack-provided rxjs or ix libraries.

Do you have any thoughts on this? I think that this project would be awesome to use, and honestly I am surprised that there otherwise doesn't seem to be anything similar to DynamicData in the JS ecosystem.

@andersstorhaug andersstorhaug changed the title Usage via NPM Usage via NPM/Skypack Jan 13, 2022
@andersstorhaug andersstorhaug changed the title Usage via NPM/Skypack Usage via CDN Jan 13, 2022
@andersstorhaug
Copy link
Author

andersstorhaug commented Jan 13, 2022

I was actually able to partially work around this by using an import map and shim, which seems to fix any bare import {...} from "tslib" imports in Skypack-provided IxJS files.

<script type="importmap">
  {
    "imports": {
      "tslib": "https://cdn.skypack.dev/tslib"
    }
  }
</script>
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js"></script>

This lead to the next error: SyntaxError: The requested module '/-/[email protected]/dist=es2019,mode=imports/unoptimized/util/comparer.js' does not provide an export named 'comparer'.

I think perhaps the root issue is that IxJS's package.json doesn't have entries for JS modules.

Might be a shot in the dark, I am not terribly familiar with all of this.

@andersstorhaug
Copy link
Author

andersstorhaug commented Jan 13, 2022

Raised an issue on IxJS to see how this might be resolved. This library might be able to depend on @reactivex/ix-esnext-esm instead of ix but I don't know if that's a good idea.

@andersstorhaug
Copy link
Author

Closing because this is specifically an issue with the ix package.

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

1 participant