-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
All modern browsers (including firefox) support es modules, but there is not 'module resolver' on the web, which means that browsers require relative URLs for module files.
import foo from 'foo' // sad browser 😢
import bar from '../bar/bar.js' // happy browser 😃
For users that do not need a complicated (or any) build step, apollo-client should provide a browser-friendly package with relative imports. This can be mechanically prepared.
Intended outcome:
This Just Works:
<script type="module">
import { ApolloClient } from '/node_modules/apollo-client/ApolloClient.js';
</script>
Actual outcome:
Chrome 64:
Uncaught TypeError: Failed to resolve module specifier "apollo-link". Relative references must start with either "/", "./", or "../".
How to reproduce the issue:
Same as Intended outcome
Version
- apollo-client@2.2.5
Notes
I was unable to find a rollup plugin which would do this automatically, but I'm reasonably confident that such a plugin would not be hard to implement.
morbidick, GitHub30, heruan, liang-yan, dozenit and 1 more
Metadata
Metadata
Assignees
Labels
No labels