Glitch Node fastify has error when Importing modules

when I work on local maching theres no error, but when uploaded to glitch errors occure

import dotenv from "dotenv";

       ^^^^^^

SyntaxError: Unexpected identifier

    at Module._compile (internal/modules/cjs/loader.js:723:23)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

    at Module.load (internal/modules/cjs/loader.js:653:32)

    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)

    at startup (internal/bootstrap/node.js:283:19)

    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

The first thing to check is that you have included it in the list of dependencies in your package.json file.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.