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

Does not work with Nest.JS webpack compiler #113

Open
HenryWu01 opened this issue Jun 27, 2023 · 0 comments
Open

Does not work with Nest.JS webpack compiler #113

HenryWu01 opened this issue Jun 27, 2023 · 0 comments

Comments

@HenryWu01
Copy link

Here is my webpack.config.js:

const transformer = require('ts-type-checked/transformer');

module.exports = function (options) {
    return {
        ...options,
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    loader: 'ts-loader',
                    options: {
                        getCustomTransformers: (program) => ({
                            before: [transformer(program)]
                        })
                    }
                }
            ]
        }
    };
};

After many deprecated warnings, webpack build failed:


> xxxxxxxx@0.0.1 start:dev
> nest start --watch


 Info  Webpack is building your sources...

DeprecationWarning: 'createIdentifier' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'updateSourceFile' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createLiteral' has been deprecated since v4.0.0. Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead.
DeprecationWarning: 'createParameterDeclaration' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createToken' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: '' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createCallExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createStrictInequality' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createNull' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createParenthesizedExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createLogicalAnd' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createElementAccessExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createTypeOfExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createStrictEquality' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createLogicalOr' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createArrowFunction' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createVariableDeclaration' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createVariableStatement' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createPropertyAssignment' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
DeprecationWarning: 'createObjectLiteralExpression' has been deprecated since v4.0.0. Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead.
C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Compilation.js:4667
                                                                if (!inTry) throw err;
                                                                            ^

TypeError: Cannot read properties of null (reading 'toString')
    at Watching.afterCallback [as handler] (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\@nestjs\cli\lib\compiler\webpack-compiler.js:60:39) 
    at handleError (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Watching.js:246:9)
    at Watching._done (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Watching.js:282:19)
    at onCompiled (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Watching.js:171:27)
    at C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Compiler.js:1192:25
    at finalCallback (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Compilation.js:2790:11)
    at C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Compilation.js:3062:18
    at eval (eval at create (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:12:1)
    at fn (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\webpack\lib\Compilation.js:481:17)
    at Hook.eval [as callAsync] (eval at create (C:\Users\Henry\Documents\xxxxxx\xxxxxx\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:10:1)

Node.js v18.13.0
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