Ember CLI Import Polyfill

raw JSON →
0.2.0 verified Thu Apr 23 auth: no javascript abandoned

This package, `ember-cli-import-polyfill`, is an Ember CLI addon designed to backport a newer addon import API (specifically referencing Ember CLI pull request #5877) to earlier versions of Ember CLI. Ember CLI is a foundational command-line utility for managing Ember.js applications, providing a robust build pipeline, project structure conventions, and an extensible addon system. Released at version 0.2.0 and last published approximately eight years ago, this addon addressed compatibility issues during a transition period in Ember CLI's internal architecture. Its purpose was to enable addon authors to leverage newer JavaScript module APIs while maintaining backward compatibility with older host Ember CLI applications that did not natively support these module APIs. Due to its age and the natural evolution of Ember CLI, the functionality it polyfilled is now standard in modern Ember CLI versions, rendering this specific polyfill obsolete.

error Error: Cannot find module 'ember-cli-import-polyfill'
cause The package was not correctly installed, or a symlink is breaking its internal resolution within Ember CLI's build process, as noted in the README.
fix
Run npm install ember-cli-import-polyfill or yarn add ember-cli-import-polyfill. If still failing, check for symlink usage and reinstall without symlinks. Ensure ember-cli is also correctly installed.
error Build failed. The Broccoli Plugin '...' failed with: ... (related to module resolution or addon processing)
cause Likely a conflict with a newer Ember CLI version's internal module handling, as this polyfill attempts to modify core import behavior for older versions.
fix
This addon is designed for older Ember CLI versions. If you are on a modern Ember CLI, remove ember-cli-import-polyfill from your project. If you *must* use an older Ember CLI, ensure its version aligns with the polyfill's expected environment.
deprecated This package is very old (last updated 8 years ago, v0.2.0) and targets a specific, outdated pull request (#5877) in Ember CLI. Its functionality is almost certainly integrated into current Ember CLI versions, making it unnecessary and potentially incompatible with modern Ember.js applications.
fix For modern Ember.js applications (Ember CLI v3.x and above), simply do not install this package. The 'addon import API' it polyfilled is now standard.
gotcha The README explicitly states, 'This addon doesn't work when symlinked, because it needs implicit access to your ember-cli module.' This can cause issues in development environments where `npm link` or `yarn link` are used for local addon development.
fix Avoid symlinking this addon. If developing locally, ensure it's installed directly from a registry or a local path without symlinks. This limitation highlights its deep integration with the Ember CLI build process.
breaking Using this polyfill in newer Ember CLI versions (e.g., 3.x+) could lead to unexpected build failures or runtime errors due to conflicts with native Ember CLI features or module resolution logic. It targets an architectural gap that no longer exists.
fix Remove `ember-cli-import-polyfill` from `package.json` and `node_modules`. Ensure your Ember CLI project is updated to a modern version that natively supports contemporary module import mechanisms.
npm install ember-cli-import-polyfill
yarn add ember-cli-import-polyfill
pnpm add ember-cli-import-polyfill

Installs the Ember CLI addon into an existing Ember.js project via the `ember install` command, which handles package installation and blueprint generation.

npx ember install ember-cli-import-polyfill

// Addons are typically installed and then automatically integrated by Ember CLI.
// No direct JavaScript import statements are typically made by end-user application code for this type of addon.
// The addon modifies the Ember CLI build pipeline or provides blueprints/components.
// For more complex polyfills or build modifications, configuration might be added to ember-cli-build.js, e.g.:

// const EmberApp = require('ember-cli/lib/broccoli/ember-app');
// module.exports = function(defaults) {
//   let app = new EmberApp(defaults, {
//     // Example of hypothetical configuration for a polyfill addon
//     'ember-cli-import-polyfill': {
//       enabled: true,
//       // specific options related to its backporting logic
//     }
//   });
//   return app.toTree();
// };