question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[25.3.1]: "Emit skipped" Error

See original GitHub issue

Tests fail with “Emit skipped” error when in Progam mode and “Emit skipped for language service” in LanguageService mode.

Works correctly with 23.2.1.

 FAIL  src/__tests__/Tree.test.tsx
  ● Test suite failed to run

    TypeError: src/testing/mocks/loadershim.js: Emit skipped

      at compileFn (node_modules/ts-jest/dist/compiler/program.js:137:23)
      at Object.compile (node_modules/ts-jest/dist/compiler/instance.js:90:25)
      at TsJestTransformer.process (node_modules/ts-jest/dist/ts-jest-transformer.js:94:41)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:446:35)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:525:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:563:25)

src/testing/mocks/loadershim.js

global.___loader = {
  enqueue: jest.fn(),
};

jest.config.js

module.exports = {
  preset: 'ts-jest/presets/js-with-ts',
  transform: {},
  testEnvironment: 'jsdom',
  setupFiles: [
    '<rootDir>/src/testing/mocks/loadershim.js',
    '<rootDir>/src/testing/mocks/react-transition-group-mock.js',
  ],
  setupFilesAfterEnv: ['<rootDir>/src/testing/setup.ts'],
  roots: ['<rootDir>/src/'],
  moduleNameMapper: {
    '.+\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
    '.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      '<rootDir>/src/testing/mocks/file-mock.js',
  },
  testPathIgnorePatterns: ['node_modules', '.cache'],
  transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
  globals: {
    __PATH_PREFIX__: '',
    'ts-jest': {
      babelConfig: true,
      tsConfig: 'tsconfig.json',
      isolatedModules: false,
      compilerHost: true,
      incremental: true,
    },
  },
};

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "lib": ["esnext", "dom"],
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "noEmit": true,
    "strict": true,
    "allowSyntheticDefaultImports": true,
    "isolatedModules": true,
    "allowJs": true,
    "esModuleInterop": true,
    "disableSizeLimit": true,
    "jsx": "preserve"
  },
  "include": ["."],
  "exclude": ["node_modules", "public", ".cache", "data", "static"]
}

deps:

"ts-jest": "25.3.1",
"typescript": "3.8.3"
"jest": "25.2.7",
"@babel/core": "7.9.0"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

12reactions
Elias-Grafcommented, Apr 12, 2021

Also faced it. But I accidently had multiple index files: index.ts and index.tsx and it’s suddenly resulted in this error

Hope it’ll help somebody

This doens’t just apply to index files, it applies to all files. I had a useChanger.tsx and a useChanger.ts and the error occurred.

Horrible error message btw, I’m sure that could be improved.

11reactions
BabkinAleksandrcommented, Dec 7, 2020

Also faced it. But I accidently had multiple index files: index.ts and index.tsx and it’s suddenly resulted in this error

Hope it’ll help somebody

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Emit skipped when parsing config typescript files
TypeScript files outside of the project folder will produce an Emit skipped error. I can't tell if this is your issue because '....
Read more >
ts-jest | Yarn - Package Manager
compiler: return file content on emitSkipped for non ts/tsx files (#2519 (a4e5640), closes #2513 · compiler: retype check other files if processing file...
Read more >
DEPARTMENT OF NATURAL RESOURCES AND ...
This Order relates to proposed regulation amendments ("Amendments") to 7 DE Admin. Code 1124, Control of Volatile Organic Compound Emissions, ...
Read more >
25. Task Execution and Scheduling - Spring
The Spring Framework provides abstractions for asynchronous execution and scheduling of tasks with the TaskExecutor and TaskScheduler interfaces, ...
Read more >
IL2CPP Win32Exception build error for Android platform
14f1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found