Comments (7)
It certainly is possible, here is a sample script with dropping flow annotations and node inspect
while running micro-dev
"dev": "node inspect -r ./node_modules/flow-remove-types/register.js ./node_modules/.bin/micro-dev lib/index.js",
from micro-dev.
Huh, it seems I can't load .mjs as my entry point via micro-dev as it needs ESM to be required via CommonJS.
from micro-dev.
The command above didn't seem to work for me so I used the method described in a similar issue on micro
node --inspect node_modules/.bin/micro-dev -p 3300
from micro-dev.
from micro-dev.
micro-dev loads your server file. It doesn't spawn a new Node.js instance or something similar. So what @jamo posted should work as expected 👍
from micro-dev.
Closing this now. Please use the solution suggested above.
from micro-dev.
Hi. Yesterday my code worked.
server: express
node: module index.mjs
import express from "express";
const app = express();
app.get('*', (req, res) => {
res.status(200).send({key:'test'});
});
export default app
now:
{
"version": 2,
"name": "WebDav",
"builds": [
{ "src": "index.mjs", "use": "
@now
/node" }
],
"routes": [
{ "src": "/", "dest": "index.mjs" }
]
}
but today it is not work.
What's happend ?
i get an error
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787: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 Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/tmp/zeit-fun-02176ca18c0dc/___now_launcher.js:21:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
How can i use *.mjs with express ?
from micro-dev.
Related Issues (20)
- Restore compatibility with micro@canary
- Update chokidar to v3 HOT 1
- Add cli arguments to documentation
- apollo-server-micro floods console with introspection logs HOT 3
- Provide an option to disable the auto copy to clipboard behaviour
- --ignore option not accepting glob HOT 1
- micro with next js restart every time on next compile
- micro-dev restarts on non-source code changes
- Yargs Parser Security Vulnerability
- Update all dependencies HOT 1
- Add ESLint and move to TypeScript
- print name of module file being used on startup.
- Purpose of SIGUSR2 signal? HOT 1
- Not compatible with `micro` v10.x HOT 3
- Windows node debugger: SyntaxError: missing ) after argument list HOT 1
- micro-dev exits on error HOT 3
- error Command failed with exit code 140 HOT 1
- UnhandledPromiseRejectionWarning thrown when content-type is not sent HOT 1
- add to readme: how to use custom now.json files with now-env
- Disable console logging? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro-dev.