You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make the above code work in a environment that doesn't support ES6 imports, you would need to use the CommonJS require syntax instead of the ES6 import syntax. Here's how the code would look:
import dotenv from "dotenv";
dotenv.config({ silent: process.env.NODE_ENV === 'production' });
const session = require('express-session');
const passport = require("passport");
import express from 'express';
import bodyParser from 'body-parser';
import mongoose from 'mongoose';
import cors from 'cors'; //doubt
import postRoutes from './routes/posts.js';
import userRouter from "./routes/user.js";
How to make the above code work in using 3rd party libraries like one without ES6 .
The text was updated successfully, but these errors were encountered: