''SyntaxError: Cannot use import statement outside a module'
I have updated by configuration to node 16.15.0 on both local machine and server. The code is running fine on local machine but on server it gives an Error - "SyntaxError: Cannot use import statement outside a module".
I have used import http from 'http';
I tried adding "type": "module" on server but it didn't solve the issue as I'm using both import and require. I am not sure how it runs on my local machine but is throwing error on server.
Can someone please help me with this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
