Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript error with verbatimModuleSyntax: true in tsconfig.json #113

Open
nktnet1 opened this issue Jan 16, 2025 · 0 comments
Open

typescript error with verbatimModuleSyntax: true in tsconfig.json #113

nktnet1 opened this issue Jan 16, 2025 · 0 comments

Comments

@nktnet1
Copy link

nktnet1 commented Jan 16, 2025

If we have the following in our tsconfig.json:

{
  "compilerOptions": {
    "skipLibCheck": true,

    // https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax
    "verbatimModuleSyntax": true
    
    
  },
  "exclude": ["node_modules"]
}

The following error occurs when running tsc:

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/index.ts:2:5 - error TS1484: 'ArrayCsvStringifierParams' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

2     ArrayCsvStringifierParams,
      ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/index.ts:4:5 - error TS1484: 'ObjectCsvStringifierParams' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

4     ObjectCsvStringifierParams
      ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/index.ts:6:9 - error TS1484: 'ArrayCsvWriterParams' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

6 import {ArrayCsvWriterParams, CsvWriterFactory, ObjectCsvWriterParams} from './lib/csv-writer-factory';
          ~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/index.ts:6:49 - error TS1484: 'ObjectCsvWriterParams' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

6 import {ArrayCsvWriterParams, CsvWriterFactory, ObjectCsvWriterParams} from './lib/csv-writer-factory';
                                                  ~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifier-factory.ts:4:9 - error TS1484: 'ObjectStringifierHeader' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

4 import {ObjectStringifierHeader} from './record';
          ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/abstract.ts:2:9 - error TS1484: 'Field' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

2 import {Field} from '../record';
          ~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/array.ts:3:9 - error TS1484: 'Field' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

3 import {Field} from '../record';
          ~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/object.ts:3:9 - error TS1484: 'Field' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

3 import {Field, ObjectHeaderItem, ObjectStringifierHeader} from '../record';
          ~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/object.ts:3:16 - error TS1484: 'ObjectHeaderItem' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

3 import {Field, ObjectHeaderItem, ObjectStringifierHeader} from '../record';
                 ~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/object.ts:3:34 - error TS1484: 'ObjectStringifierHeader' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

3 import {Field, ObjectHeaderItem, ObjectStringifierHeader} from '../record';
                                   ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/object.ts:4:19 - error TS1484: 'ObjectMap' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

4 import {isObject, ObjectMap} from '../lang/object';
                    ~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-writer-factory.ts:3:9 - error TS1484: 'ObjectStringifierHeader' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

3 import {ObjectStringifierHeader} from './record';
          ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/field-stringifier.ts:1:9 - error TS1484: 'Field' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

1 import {Field} from './record';
          ~~~~~


Found 13 errors in 7 files.

Errors  Files
     4  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/index.ts:2
     1  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifier-factory.ts:4
     1  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/abstract.ts:2
     1  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/array.ts:3
     4  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-stringifiers/object.ts:3
     1  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/csv-writer-factory.ts:3
     1  node_modules/.pnpm/[email protected]/node_modules/csv-writer/src/lib/field-stringifier.ts:1
 ELIFECYCLE  Command failed with exit code 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant