Skip to content

Upgrading to 3.7.0 #113

@unematiii

Description

@unematiii

I'm having a bit of trouble upgrading to latest (after esm/cjs changes), some of my tests (ts-jest) now fail with:

 /Users/mati/xxx/node_modules/fastify-decorators/testing/index.js:8
    export { configureControllerTest, } from './configure-controller-test.js';
    ^^^^^^

    SyntaxError: Unexpected token 'export'

    > 1 | import { configureServiceTest } from 'fastify-decorators/testing';

Linting tests also fails:

/Users/mati/xxx/tests/unit/yyyy/services/zzz.service.spec.ts
  1:1   error    Resolve error: Cannot find module '/Users/mati/xxx/node_modules/fastify-decorators/testing/index.cjs'
    at createEsmNotFoundErr (internal/modules/cjs/loader.js:907:15)
    at finalizeEsmResolution (internal/modules/cjs/loader.js:900:15)
    at resolveExports (internal/modules/cjs/loader.js:432:14)
    at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
    at findModulePath (/Users/mati/xxx/node_modules/eslint-import-resolver-alias/index.js:99:27)
    at Object.exports.resolve (/Users/mati/xxx/node_modules/eslint-import-resolver-alias/index.js:75:10)
    at v2 (/Users/mati/xxx/node_modules/eslint-module-utils/resolve.js:117:23)
    at withResolver (/Users/mati/xxx/node_modules/eslint-module-utils/resolve.js:122:16)
    at fullResolve (/Users/mati/xxx/node_modules/eslint-module-utils/resolve.js:139:22)
    at relative (/Users/mati/xxx/node_modules/eslint-module-utils/resolve.js:84:10)  import/namespace

I'm not entirely sure what needs to be changed here... Any help will be appreciated.


Update:

Might not be related, but in package.json I can see

    "./testing": {
      "import": "./testing/index.js",
      "require": "./testing/index.cjs"
    }

however, there is no index.cjs present...

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