-
Notifications
You must be signed in to change notification settings - Fork 8
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
TypeError: Class extends value undefined is not a constructor or null #16
Comments
Hi @eternalmatt are you using node v13 by chance? The underlying machinery has changed in node, which I'm addressing today. |
I'm a bit behind. node@10.14.0 and npm@6.11.3 |
Actually it appears I've solved this by adding to my jest config:
https://jestjs.io/docs/en/configuration#moduledirectories-array-string I'll close this issue now, but I'm still having issues with my project tests, where now Jest is not able to proceed past
|
I take that back. I installed core-js correctly and I'm back to having |
Sorry I didn't mention this before, I am using fs-capacitor@2.0.4. I didn't see you're on 4.0.0 now.
It's very strange, I put a breakpoint in the generated index.js file as the test is running, and when I log |
@eternalmatt - you're fine to use 2.0.4; I just made v3 and 4 over this past week (I didn't like an API ambiguity with v3, which I promptly fixed but in a breaking way). The impetuous for these was support for node v13, so as long as you aren't running it there, 2.0.4 should be just fine, and will continue to be installed by graphql-upload until this lands. Are you by chance using ES modules in your code, and if so are you transpiring them to commonjs or running them with the |
I'm using the commonjs module syntax and compiling to es2017.
|
Hmmm... would you mind pasting your whole contents of your |
Thank you for giving this so much attention. Frankly, I'm not positive the root cause here is strictly with fs-capacitor, it must have to do with jest and ts-jest. Your library works at runtime, it's the tests that are not working. Somehow they are not understanding .mjs which seems to be only a new concept in my dependencies with introduction of graphql and apollo (I'm adding this now). tsconfig.json {
"compilerOptions": {
"strictFunctionTypes": false,
"lib": ["es2017", "esnext.asynciterable"],
"module": "commonjs",
"target": "es2017",
"outDir": "../dist/",
"sourceMap": true,
"typeRoots": ["node_modules/@types"]
},
"exclude": ["**/*.spec.ts"] tsconfig.spec.js (referenced by jest.config.js)
jest.config.js const config = {
rootDir: process.cwd(),
verbose: true,
name: 'server',
preset: 'jest-preset-typescript',
testEnvironment: 'node',
globals: {
'ts-jest': {
tsConfig: '<rootDir>/server/tsconfig.spec.json',
},
},
testPathIgnorePatterns: ['<rootDir>/src', '<rootDir>/test', '<rootDir>/dist'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '<rootDir>/reports/tests',
outputName: 'unit-report.junit.xml',
},
],
],
};
module.exports = config; |
Hi @eternalmatt in versions 4 and now 5, I have moved the typescript definition files into this repo (it's actually just been rewritten in typescript generally). This should resolve any silliness with typescript. I see you're using this library through |
Just ran into this issue with node v12.14.1, I'm using the latest version of After seeing this issue, I managed to work around it using It is still problematic with the latest |
I receive the following error while executing tests with
jest
in TypeScriptwhere fs-capacitor/lib/index.js contains
my tsconfig.json is
The text was updated successfully, but these errors were encountered: