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

fallbackBindings.transform is not a function #29

Open
leap0x7b opened this issue Dec 28, 2022 · 2 comments
Open

fallbackBindings.transform is not a function #29

leap0x7b opened this issue Dec 28, 2022 · 2 comments

Comments

@leap0x7b
Copy link

(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/@[email protected]/node_modules/@swc/core/index.js:223:41)
    at Generator.next (<anonymous>)
    at /data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@[email protected]/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/@[email protected]/node_modules/@swc/core/index.js:30:12)
    at Compiler.transform (/data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@[email protected]/node_modules/@swc/core/index.js:202:16)
    at transform (/data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/@[email protected]/node_modules/@swc/core/index.js:344:21)
    at Object.transform (file:///data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/[email protected]_zz5argbrqg64xved5wkdukot6e/node_modules/rollup-plugin-swc3/dist/index.mjs:129:20)
    at /data/data/com.termux/files/home/ffmpeg-discord/node_modules/.pnpm/[email protected]/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'],
    }),
  ],
};
@SukkaW
Copy link
Owner

SukkaW commented Dec 28, 2022

Do you have @swc/core installed?

@leap0x7b
Copy link
Author

Yes

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

2 participants