Skip to content

fallbackBindings.transform is not a function #29

Description

@leap0x7b
(node:16032) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

src/index.ts → dist/index.js...
[!] (plugin swc) TypeError: fallbackBindings.transform is not a function
src/index.ts
    at Compiler.<anonymous> (/data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@swc+core@1.3.24/node_modules/@swc/core/index.js:223:41)
    at Generator.next (<anonymous>)
    at /data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@swc+core@1.3.24/node_modules/@swc/core/index.js:34:71
    at new Promise (<anonymous>)
    at __awaiter (/data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@swc+core@1.3.24/node_modules/@swc/core/index.js:30:12)
    at Compiler.transform (/data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@swc+core@1.3.24/node_modules/@swc/core/index.js:202:16)
    at transform (/data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@swc+core@1.3.24/node_modules/@swc/core/index.js:344:21)
    at Object.transform (file:///data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/rollup-plugin-swc3@0.8.0_zz5argbrqg64xved5wkdukot6e/node_modules/rollup-plugin-swc3/dist/index.mjs:129:20)
    at /data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/rollup@3.8.1/node_modules/rollup/dist/shared/rollup.js:24076:40

My rollup.config.js

import alias from '@rollup/plugin-alias';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
// import exportDirectoryRollup from 'export-directory/dist/rollup';
import { resolve } from 'path';
import { swc, defineRollupSwcOption } from 'rollup-plugin-swc3';
import swcConfig from './.swcrc.json' assert { type: "json" };

export default {
  input: 'src/index.ts',
  output: {
    file: 'dist/index.js',
    format: 'esm',
  },
  plugins: [
    swc(defineRollupSwcOption(swcConfig)),
    alias({
      entries: {
        $lib: resolve('./src/lib'),
        $core: resolve('./src/core'),
      },
    }),
    // exportDirectoryRollup({}),
    commonjs(),
    nodeResolve({
      browser: true,
      extensions: ['.mjs', '.js', '.ts', '.json'],
    }),
  ],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions