Skip to content

analytics-utils: incorrect reference to cjs main entrypoint in 1.1.0 #501

@real34

Description

@real34

What happens

When I install @analytics/core in my project, with analytics-utils 1.1.0 I get the following error:

> tmp-fc-test-skeleton-test-app@3.14.0 dev /tmp/fc-test-skeleton/test-app
> node --import tsx/esm ./server.mjs

node:internal/modules/cjs/loader:1437
  const err = new Error(`Cannot find module '${request}'`);
              ^

Error: Cannot find module '/tmp/fc-test-skeleton/test-app/node_modules/.pnpm/@analytics+core@0.12.17_@types+dlv@1.1.5/node_modules/analytics-utils/dist/analytics-utils.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1437:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1426:15)
    at resolveExports (node:internal/modules/cjs/loader:657:14)
    at Function._findPath (node:internal/modules/cjs/loader:749:31)
    at node:internal/modules/cjs/loader:1387:27
    at m._resolveFilename (file:///tmp/fc-test-skeleton/test-app/node_modules/.pnpm/tsx@4.19.2/node_modules/tsx/dist/register-RyGUjI6j.mjs:1:789)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
    at Function._load (node:internal/modules/cjs/loader:1211:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14) {
  code: 'MODULE_NOT_FOUND',
  path: '/tmp/fc-test-skeleton/test-app/node_modules/.pnpm/@analytics+core@0.12.17_@types+dlv@1.1.5/node_modules/analytics-utils'
}

Expected

The app should start properly. It worked fine yesterday (i.e: with the previous version).

Analysis

The package.json still refers to dist/analytics-utils.js but when analyzing the packaged code it now is named dist/analytics-utils.cjs.

Should the main entrypoint be updated accordingly to prevent this issue?

💡 Other packages (such as @analytics/type-utils and @analytics/storage-utils) also seem impacted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions