Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions packages/ember-auto-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,42 @@ This can be imported like:
import 'eventsource/example/eventsource-polyfill.js';
```

### I get a `Package path ./foo is not exported from package` error at runtime.

Check the package.json `"exports"` config for the library you're trying to import. ember-auto-import only automatically includes files with the `"browser"` condition.

```js
// Example package.json from @googleworkspace/drive-picker-element
"type": "module",
"exports": {
".": {
"browser": "./dist/index.iife.min.js",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./drive-picker": {
"types": "./dist/drive-picker/index.d.ts",
"import": "./dist/drive-picker/index.js"
},
"./package.json": "./package.json"
},
```

If the file you want to import is specified under some other condition, such as `"import"` for ESM, you'll have to provide additional webpack config like this:

```js
// In your app's ember-cli-build.js file or check the `Usage from Addons` section for relevant usage of the following in addons
let app = new EmberApp(defaults, {
autoImport: {
webpack: {
resolve: {
conditionNames: ['import'],
},
},
},
});
```

## Debugging Tips

Set the environment variable `DEBUG="ember-auto-import:*"` to see debug logging during the build.
Expand Down
Loading