Skip to content

[Bug]: No matching export for import "default" (Ionic / Angular) #1123

@hoermillerj

Description

@hoermillerj

What happened?

After updating from v.5.2.15 to v.5.2.18 the import of OneSignal import OneSignal from 'onesignal-cordova-plugin'; does not work anymore. When I try to build my application I am faced with the following error message:

X [ERROR] No matching export in "node_modules/onesignal-cordova-plugin/dist/index.js" for import "default"

It seems to me that the OneSignal plugin exports a default export (exports.default=h) but uses CommonJS format, and my Angular project is trying to import it as an ES module with a default import.

When I roll back to version 5.2.15 everything works fine.

Steps to reproduce?

1. Setup new Angular project
2. Install OneSignal (npm i onesignal-cordova-plugin)
3. Import OneSignal as described in the documentation (import OneSignal from 'onesignal-cordova-plugin';)
4. Build the project

What did you expect to happen?

I expect the project to build without any issues.

OneSignal Cordova SDK version

5.2.18

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Application bundle generation failed. [10.088 seconds] - 2025-12-01T08:33:18.356Z

X [ERROR] No matching export in "node_modules/onesignal-cordova-plugin/dist/index.js" for import "default"

    src/app/app.ts:3:7:
      3 │ import OneSignal from 'onesignal-cordova-plugin';

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions