I apologize if this error is extremely easily fixed. I am just getting started with Node.js Discord bot development with slash commands, and I am not having any luck finding answers elsewhere online.
I am programming a bot based on this example Discord app. The project runs perfectly well on my machine. When I run it on Glitch, however, I see the following error:
import "dotenv/config";
^^^^^^^^^^^^^^^
SyntaxError: Unexpected string
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)
Here are the first few lines of app.js
:
import "dotenv/config";
import express from "express";
What can I do to permit Glitch to recognize this import statement?