bluebeel / now-nuxt Goto Github PK
View Code? Open in Web Editor NEWA Now v2 Nuxt builder
A Now v2 Nuxt builder
I'm trying to get my nuxt project working with version 2 and this build, but I'm getting build errors.
{
"version": 2,
"name": "nuxt",
"alias": "nuxt.example.com",
"env": {
"NODE_ENV": "production",
},
"builds": [
{ "src": "nuxt.config.js", "use": "@bluebeel/nuxt" }
]
}
12/30 11:56 PM (5m)
error /tmp/69374d61/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: /tmp/69374d61/node_modules/cypress
Output:
Installing Cypress (version: 3.1.4)
?25l[22:56:11] Downloading Cypress [started]
[22:56:12] Downloading Cypress 0% 0s [title changed]
[22:56:12] Downloading Cypress 4% 2s [title changed]
[22:56:12] Downloading Cypress 10% 2s [title changed]
[22:56:12] Downloading Cypress 15% 2s [title changed]
[22:56:12] Downloading Cypress 21% 2s [title changed]
[22:56:12] Downloading Cypress 27% 1s [title changed]
[22:56:12] Downloading Cypress 32% 1s [title changed]
[22:56:12] Downloading Cypress 38% 1s [title changed]
[22:56:12] Downloading Cypress 42% 1s [title changed]
[22:56:13] Downloading Cypress 47% 1s [title changed]
[22:56:14] Downloading Cypress 53% 2s [title changed]
[22:56:14] Downloading Cypress 57% 1s [title changed]
[22:56:14] Downloading Cypress 62% 1s [title changed]
[22:56:14] Downloading Cypress 69% 1s [title changed]
[22:56:14] Downloading Cypress 74% 1s [title changed]
[22:56:14] Downloading Cypress 81% 1s [title changed]
[22:56:14] Downloading Cypress 87% 0s [title changed]
[22:56:14] Downloading Cypress 93% 0s [title changed]
[22:56:14] Downloading Cypress 100% 0s [title changed]
[22:56:14] Downloaded Cypress [title changed]
[22:56:14] Downloaded Cypress [completed]
[22:56:14] Unzipping Cypress [started]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14] Unzipping Cypress 0% 0s [title changed]
[22:56:14]
12/30 11:56 PM (5m)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
12/30 11:56 PM (5m)
patching https://api-bru1.zeit.co/v2/now/deployments/dpl_F9wfTrTtPzNKPrBPJNbxPiJ1J6op/builds/bld_8act7psak with {"readyState":"ERROR","errorCode":"BUILD_FAILED"}
12/30 11:56 PM (5m)
{ Error: Exited with 1
at ChildProcess.child.on (/tmp/utils/node_modules/@now/build-utils/fs/run-user-scripts.js:11:16)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) reported: true }
Does it has something to do with devDependencies (Cypress) being installed?
Hello
I'd like (for caching purpose) having hashed version of filenames. Otherwise browser cached files will be delivered for users and this can lead to unexpected behaviour.
Currently this builder only works with
filenames: {
app: '[name].js',
chunk: '[name].js'
}
Any idea how this could be solved?
Thanks
I did the following
yarn create nuxt-app nuxt-test
cd nuxt-text
# create now.json with same content as in bluebeel/now-nuxt/README.md
# made changes to nuxt.config.js according to bluebeel/now-nuxt/README.md
now
It goes through the build just fine (although it takes about 15 minutes, which I guess is expected). After navigating to the route, I get an error (ERR_INVALID_RESPONSE)
The logs say
02/05 02:35 PM (7m)
Unable to import module 'now__launcher': Error
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/task/nuxt.config.js:2:13)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
02/05 02:35 PM (7m)
REPORT RequestId: 305447d6-ef7d-4c21-bc9f-11dd18a0344c Duration: 0.48 ms Billed Duration: 100 ms Memory Size: 3008 MB Max Memory Used: 92 MB
create-nuxt-app config
? Project name nuxt-test
? Project description My glorious Nuxt.js project
? Use a custom server framework none
? Choose features to install Progressive Web App (PWA) Support, Linter / Formatter, Prettier, Axios
? Use a custom UI framework vuetify
? Use a custom test framework jest
? Choose rendering mode Universal
? Author name Me
I'm trying to get Nuxt running on V2.
now.json
{
"name": "point-campus",
"version": 2,
"alias": [
"www.pointcampus.ie"
],
"builds": [
{
"src": "nuxt.config.js",
"use": "@bluebeel/nuxt"
}
],
"routes": [
{
"src": "/(.*)",
"status": 301,
"headers": {
"Location": "https://pointcampus.ie/$1"
}
}
]
}
If I then run now
, I get the following message:
> Deploying ~/Documents/websites/point-campus under pointcampus
> Using project point-campus
> Synced 3 files (5.49KB) [1s]
> https://point-campus-f7tudmgty.now.sh [v2] [in clipboard] [5s]
╶ nuxt.config.js Error [59s]
> Error! 1 build failure occured.
If I then look at the logs...it spits out a load of info but it's at this point that the log states there's an error:
2019-01-25T15:49:48.765Z error [email protected]: The engine "node" is incompatible with this module. Expected version ">= 9.0.0". Got "8.10.0"
2019-01-25T15:49:48.781Z error Found incompatible module
2019-01-25T15:49:48.781Z info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2019-01-25T15:49:48.805Z Error: Exited with 1
at ChildProcess.child.on (/tmp/utils/node_modules/@now/build-utils/fs/run-user-scripts.js:14:16)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2019-01-25T15:49:48.805Z patching https://api-bru1.zeit.co/v2/now/deployments/dpl_7HHKGc37rcW7b7SFEyPprLAHkqxP/builds/bld_mhh1i0rq0 with {"readyState":"ERROR","errorCode":"BUILD_FAILED_2"}
If I check in the [email protected]
node module, I see it states:
"engines": {
"node": ">= 9.0.0",
"npm": ">= 6.0.0"
}
So I'm not sure why that's breaking if it states the expected version is ">= 9.0.0"?
I know in the docs it states to update the Nuxt config file to utilise:
module.exports = () => {
return {}
}
But if I do that, I get errors running the dev build (npm run dev
).
My current config setup is in this format (just an object):
module.exports = {}
Could that be the issue at hand?
Thanks
Hi
what is the best way for a catch all routes config inside the now.json? I am not sure how that need to be configured. I did this routes section inside the nuxt config:
router: {
extendRoutes (routes, resolve) {
routes.push({
name: 'custom',
path: '/:slug*',
component: '~/pages/index.vue'
})
}
},
now.json:
"routes": [
{
"src": "^/(.+)\\.(.+)$",
"dest": "index"
}
]
I am also unsure if the serverMiddleware will be triggered correctly, or do I need to set them up inside of the routes section as well?
Hello
this package always results in the following now error:
The lambda function size (130.17mb) exceeds the configured limit (50mb).
Only the very first build command succeeds. The dependencies are fairly small this should not be the issue. Is there any now command I am overlooking to clean up the size?
hello, I set nuxt project like this #4 (comment),
but when I run yarn run dev
, nuxt.config.js not work.
how to solve it.
The duration of the build on the zeit.co platform is currently quite high even for a simple project containing only a Hello World.
This problem is due to some of the code rather disturbing but important.
See below.
Lines 130 to 133 in 5ff0dc4
Lines 31 to 47 in 5ff0dc4
The node_modules folder is added to the lambda build because it is used by the launcher.js file which require nuxt.
Hello,
I just tried out your builder but for me the most basic example does not work as expected:
{
"version": 2,
"name": "nuxt-storyblok-naturheilpraxis",
"public": false,
"builds": [
{
"src": "nuxt.config.js",
"use": "@bluebeel/nuxt"
}
]
}
I only have one index.vue file inside of pages and instead of render the HTML only a file directory is shown: https://nuxt-storyblok-naturheilpraxis-lfiz4w3v2.now.sh/
Is there some configuration missing? This is the configuration part of nuxt.config.js:
srcDir: 'src/',
mode: 'universal',
router: {
middleware: 'languageDetection',
extendRoutes (routes, resolve) {
routes.push({
name: 'custom',
path: '/:slug*',
component: '~/pages/index.vue'
})
}
},
serverMiddleware: [
'~/server-middleware/server-middleware'
],
render: {
resourceHints: false,
http2: {
push: true
},
static: {
maxAge: '1y'
}
},
modern: 'server'
It seems the index.html file is not being generated by the builder.. only the _nuxt/[*].js files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.