Giter VIP home page Giter VIP logo

Comments (2)

Brooooooklyn avatar Brooooooklyn commented on June 12, 2024

Could you provide a minimal code snippet to reproduce this issue?

from swc-node.

pincman avatar pincman commented on June 12, 2024

@Brooooooklyn
My code

@Delete()
    @SerializeOptions({ groups: ['category-list'] })
    async destroyMulti(
        @Query()
        { page, limit }: QueryCategoryDto,
        @Body()
        { trash, categories }: DeleteCategoryMultiDto,
    ) {
        return this.categoryService.deletePaginate(
            categories,
            {
                page,
                limit,
            },
            {},
            trash,
        );
    }

and
if running by @swc/register every thing is work fine

const runner = nodemon({
        script: 'src/main.ts',
        ext: 'js,json,ts',
        watch: ['src'],
        ignore: ['.git', 'node_modules', 'dist', 'scripts'],
        execMap: {
            ts: 'node -r @swc/register -r module-alias/register',
        },
        env: {
            NODE_ENV: environment(),
        },
        cwd: path.resolve(__dirname, '..', '..'),
        spawn: true,
    });
    runner.once('start', () => {
        console.log();
        console.log('Server has started:');
        if (urls.length > 0) {
            console.log(`- Local: ${chalk.green.underline(urls[0])}`);
        }
        if (urls.length > 1) {
            console.log(`- Network: ${chalk.green.underline(urls[1])}`);
        }
    });
    runner.on('restart', () => {
        console.log();
        console.log(chalk.yellow('Server is in restarting...'));
    });

image
but when change to @swc-node/register,will get this error

 execMap: {
            ts: 'node -r @swc-node/register -r module-alias/register',
        },

image

I think the reason that is @swc-node/register not read the config file .swcrc,

{
    "sourceMaps": false,
    "jsc": {
        "loose": true,
        "parser": {
            "syntax": "typescript",
            "decorators": true
        },
        "transform": {
            "legacyDecorator": true,
            "decoratorMetadata": true
        },
        "target": "es2020",
        "externalHelpers": false
    },
    "module": {
        "type": "commonjs"
    }
}

how to read it for this project @swc-node?

from swc-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.