Comments (5)
@pancho111203 can you set config.target to serverless
? we try to do this for you within the plugin, but this is a great example of an "edge case" where people are using this format for their config file, where our logic won't work.
at the very least, for now, i'll update the error message to be way more clear. let me know if setting config.target fixes your issue!!
from next-runtime.
@lindsaylevine Great, that fixes it! Thanks a lot
from next-runtime.
from next-runtime.
hey @pancho111203! what does your next.config.js look like?
from next-runtime.
const withLess = require('@zeit/next-less');
const lessToJS = require('less-vars-to-js');
const fs = require('fs');
const path = require('path');
const withOptimizedImages = require('next-optimized-images');
// Where your antd-custom.less file lives
const themeVariables = lessToJS(
fs.readFileSync(path.resolve(__dirname, './assets/antd-custom.less'), 'utf8')
);
const webpackObj = withOptimizedImages(
withLess({
lessLoaderOptions: {
javascriptEnabled: true,
modifyVars: themeVariables,
},
webpack: (config, { isServer }) => {
if (isServer) {
const antStyles = /antd\/.*?\/style.*?/;
const origExternals = [...config.externals];
config.externals = [
(context, request, callback) => {
if (request.match(antStyles)) {
return callback();
}
if (typeof origExternals[0] === 'function') {
origExternals[0](context, request, callback);
} else {
callback();
}
},
...(typeof origExternals[0] === 'function' ? [] : origExternals),
];
config.module.rules.unshift({
test: antStyles,
use: 'null-loader',
});
}
return config;
},
})
);
webpackObj['rewrites'] = async function() {
return [
{
source: '/blog/wp-admin',
destination: '.....',
},
{
source: '/blog/:path*',
destination: '.....',
},
]
}
module.exports = webpackObj;
from next-runtime.
Related Issues (20)
- [Bug]: API Routes return 502 due to Headers reference error HOT 1
- [Bug]: @netlify/plugin-nextjs is messing up everything HOT 2
- [Bug]: ENOENT internal error with monorepo setup HOT 7
- [Bug]: Plugin "@netlify/plugin-nextjs" internal error: ENOENT: no such file or directory with runtime 5.0.0-beta.7 HOT 9
- [Bug]: Issue with data revalidation after new build HOT 3
- [Bug]: NETLIFY_NEXT_PLUGIN_SKIP no longer works in v5 HOT 7
- Nonce not automatically set in script tags when using CSP
- Middleware on sites with i18n cannot rewrite to static files
- Middleware should not add trailing slashes to non-data requests in static dir
- Pages router middleware should return 302 status for redirected data requests
- Server error pages return encoded data without `content-encoding` header if `accept-encoding` is `gzip`
- Fetch action prefetch cache test failing
- Appending `set-cookie` header in middleware leads to duplicate header
- Pages router data requests returning 404 when middleware is used
- Middleware does not match when using basePath and default locale
- Middleware matching is too broad when using i18n
- Does not correctly handle user middleware that redirects to path with canonical locale casing when app enables `skipMiddlewareUrlNormalize` and path contains locale slug with non-canonical casing
- 5.3.3 build error HOT 5
- cancel
- Local builds: `netlify build` followed by `netlify deploy` doesn't work with Next.js sites HOT 2
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 next-runtime.