heroiclabs / nakama-docs

Documentation for Nakama social and realtime server.
https://heroiclabs.com/docs
Apache License 2.0
43 stars 68 forks source link

Rollup error #214

Closed MWFIAE closed 3 years ago

MWFIAE commented 3 years ago

After following the rollup setup guide I faced the following error

image

I could get it working by deleting the references in the rollup.config.json.

My final file looks like that:

//import resolve from "@rollup/plugin-node-resolve";
import commonJS from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import babel from "@rollup/plugin-babel";
import typescript from "@rollup/plugin-typescript";
import pkg from "./package.json";

const extensions = [".mjs", ".js", ".ts", ".json"];

export default {
    input: "./src/index.ts",
    external: ["nakama-runtime"],
    plugins: [
        // Allows node_modules resolution
        // throws weird errors, uncommented for now.
        //resolve({ extensions }),

        // Compile TypeScript
        typescript(),
        json(),
        // Resolve CommonJS modules
        commonJS({ extensions }),

        // Transpile to ES5
        babel({
            extensions,
            babelHelpers: "bundled",
        }),
    ],
    output: {
        file: pkg.main,
    },
};

Thank you very much!

MWFIAE commented 3 years ago

For everybody else running into this:

For me it had nothing to do with the project, configuration or nakama itself. Instead it seems like the path to my dev folder was either too long or did contain a special character that node resolve couldn't handle correctly.

Now I just wish that rollup did have better error messages 😜