Skip to content

Failed to resolve entry for package #28

@gavrashenko

Description

@gavrashenko

I'm facing an error while running unit tests (vitest):

Error: Failed to resolve entry for package "@analytics-debugger/ga4mp". The package may have incorrect main/module/exports specified in its package.json.

The issue is due to incorrect entries in the package.json:

"main": "dist/ga4mp.min.js", // 404 file
"module": "dist/ga4mp.esm.min.js", // ok
"browser": "dist/ga4mp.min.js", // 404 file

Pre-validation fails because of this. It can be easily fixed by using the correct files:

"main": "dist/ga4mp.umd.min.js",
"module": "dist/ga4mp.esm.min.js",
"browser": "dist/ga4mp.umd.min.js", // or iife as well

ga4mp version: v0.0.8
node: v20.9.0
vitest: v0.34.6

I temporarily resolved this issue by editing the package.json (replacing ga4mp.min.js with ga4mp.umd.min.js) in the postinstall script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions