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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

require(...).createTransformer is not a function #348

Open
YunFeng-Huang opened this issue Jun 2, 2021 · 3 comments
Open

require(...).createTransformer is not a function #348

YunFeng-Huang opened this issue Jun 2, 2021 · 3 comments
Labels
jest 27 upstream Due to other packages (like Jest)
Milestone

Comments

@YunFeng-Huang
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch vue-jest@5.0.0-alpha.10 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/vue-jest/lib/utils.js b/node_modules/vue-jest/lib/utils.js
index 2949ed2..92694ee 100644
--- a/node_modules/vue-jest/lib/utils.js
+++ b/node_modules/vue-jest/lib/utils.js
@@ -73,8 +73,7 @@ const getTsJestConfig = function getTsJestConfig(config) {
   if (!isUsingTs) {
     return null
   }
-
-  const createTransformer = require('ts-jest').createTransformer
+  const { createTransformer } = require('ts-jest')
   const tr = createTransformer()
   const configSet = tr.configsFor(config)
   const tsConfig = configSet.typescript || configSet.parsedTsConfig

This issue body was partially generated by patch-package.

@YunFeng-Huang
Copy link
Author

require(...).createTransformer is not a function

@lmiller1990
Copy link
Member

lmiller1990 commented Jun 14, 2021

Hi, can you share your config and package.json, or ideally a minimal reproduction? I have not encountered this issue before. I wonder if ts-jest changed something. Or are you on Jest v27?

@lmiller1990
Copy link
Member

Most likely related to jest 27. See #343 for more info.

@nogic1008 nogic1008 added this to the 27.x milestone Jun 17, 2021
@nogic1008 nogic1008 added the upstream Due to other packages (like Jest) label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jest 27 upstream Due to other packages (like Jest)
Projects
None yet
Development

No branches or pull requests

3 participants