Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    蔡福令
    @chaifuling
    问下next 可以结合umi吗
    youjiti
    @youjiti
    支持hooks吗
    lijian
    @SJanJan
    怎么配置让next能够使用bootstrap?
    龙少
    @z1769057083
    客户端跨域访问怎么实现
    以前让后台做的允许跨域
    我想知道next.config.js中能配置跨域访问吗
    有人吗
    Andi Chou
    @andichou

    hi guys,

    Ask, can we deploy nextjs with aws appsync as static website to s3?
    does it works?

    kang
    @ZWkang
    像正常的node应用配置跨域即可 @z1769057083
    龙少
    @z1769057083
    next.js postcss配置
    我这边不生效
    有人配置生效了吗
    子慕大诗人
    @zimv
    @z1769057083 根目录建立postcss.config.js。
    const pxtorem = require("postcss-pxtorem");
    module.exports = {
    plugins: [
    pxtorem({
    rootValue: 50,
    unitPrecision: 5,
    propList: ["*"],
    selectorBlackList: [/^.nop2r/,/^.am/],
    replace: true,
    mediaQuery: false,
    minPixelValue: 0
    })
    ]
    };
    Zhao-LiZhong
    @Zhao-LiZhong
    server获取的数据怎么放到store中
    大神帮我一下呗
    保持数据同步
    子慕大诗人
    @zimv
    @Zhao-LiZhong 官方不是有redux示例吗
    常德闯
    @dechuangchang
    大佬们好 with-ant-design-app 生产环境antd组件第一次总有一个蕾丝入场动画的东西 怎么解决
    chrome 其他浏览器没发现
    Feng
    @linfengluo
    大佬: 求助!You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.
    已设置 env === production && mode === production
    这个报错是从redux-saga 中提示的
    是哪里设置错误了吗
    Feng
    @linfengluo
    next.config.js 配置
    const withLess = require('@zeit/next-less');
    const withCss = require('@zeit/next-css');
    const path = require('path');
    
    module.exports = withLess(
      withCss({
        cssModules: true,
        cssLoaderOptions: {
          importLoaders: 1,
          localIdentName: '[local]__[hash:base64:5]',
        },
        lessLoaderOptions: {
          javascriptEnabled: true,
        },
        webpack(config, { webpack, isServer }) {
          config.resolve.alias['@'] = path.join(__dirname, 'src');
          config.resolve.alias['@page'] = path.join(__dirname, 'pages');
          config.resolve.alias['@root'] = path.join(__dirname, '');
    
          if (process.env.NODE_ENV === 'production') {
            config.mode = 'production';
            config.plugins.unshift(
              new webpack.DefinePlugin({
                'process.env.NODE_ENV': JSON.stringify('production'),
              }),
            );
          }
    
          config.module.rules.push({
            test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
            loader: 'url-loader',
            options: {
              limit: 8192,
              name: path.posix.join('static', 'img/[name].[hash:7].[ext]'),
              fallback: 'file-loader',
              publicPath: '/_next/',
              outputPath: '',
            },
          });
    
          return config;
        },
      }),
    );
    guibwl
    @guibwl
    为什么我们配置的loader无效。。

    webpack (config, { webpack, isServer }) {
    if (process.env.NODE_ENV === 'production') {
    config.mode = 'production'
    config.plugins.unshift(
    new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify('production')
    }),
    )
    }

    config.module.rules.push({
      test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
      loader: 'url-loader',
      options: {
        'limit': 10000,
        'name': '[name].[contenthash:8].[ext]',
        'outputPath': 'static/media/',
        'publicPath': 'https://registry.npm.taobao.org/',
        fallback: 'file-loader'
      }
    })
    
    return config

    }
    想加publicPath 来切换CDN

    乔健
    @bramblex
    这里有人吗?
    求请加一个问题,nextjs 是不会把依赖过 babel 的吗?
    ROne
    @ravi-mone
    Hello Guys,
    I need a help, currently in my company they have a project which is built on next7, and is little slow with GTmatrix scoring (61%). So planning to update to next9. Here is my package.json file, can you guys please point me out which all the libraries I need to update or include if I want to make it work.
    Please Help, Thanks
    {
      "name": "MyApp",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "@babel/polyfill": "^7.0.0",
        "@fortawesome/fontawesome-svg-core": "^1.2.6",
        "@fortawesome/free-brands-svg-icons": "^5.4.1",
        "@fortawesome/free-regular-svg-icons": "^5.4.1",
        "@fortawesome/free-solid-svg-icons": "^5.4.1",
        "@fortawesome/react-fontawesome": "^0.1.3",
        "@sentry/browser": "^5.6.2",
        "@zeit/next-css": "^1.0.1",
        "@zeit/next-sass": "^1.0.1",
        "autoprefixer": "^9.4.2",
        "axios": "^0.18.0",
        "axios-jsonp": "^1.0.2",
        "babel-plugin-transform-define": "^1.3.0",
        "babel-plugin-transform-remove-strict-mode": "0.0.2",
        "babel-plugin-transform-runtime": "6.23.0",
        "babel-preset-env": "1.6.1",
        "babel-runtime": "6.26.0",
        "bootstrap": "^4.1.3",
        "classnames": "^2.2.6",
        "clevertap-react": "^1.0.0",
        "cross-env": "^5.2.0",
        "css-purify-webpack-loader": "^1.0.1",
        "dom-css": "^2.1.0",
        "dotenv": "^6.0.0",
        "enzyme": "^3.7.0",
        "enzyme-adapter-react-16": "^1.6.0",
        "eventemitter2": "^5.0.1",
        "express": "^4.16.3",
        "file-loader": "^2.0.0",
        "keymirror": "^0.1.1",
        "lockr": "^0.8.5",
        "lodash": "^4.17.11",
        "material-ui": "^0.20.2",
        "md5": "^2.2.1",
        "moment": "^2.22.2",
        "next": "^7.0.0",
        "next-workbox-webpack-plugin": "^1.1.0",
        "node-sass": "^4.9.3",
        "node-sass-chokidar": "^1.3.3",
        "npm-run-all": "^4.1.3",
        "pm2": "^3.1.3",
        "postcss": "^7.0.6",
        "prop-types": "^15.6.2",
        "react": "^16.5.1",
        "react-async-script-loader": "^0.3.0",
        "react-confirm-alert": "^2.1.0",
        "react-content-loader": "^3.4.1",
        "react-custom-scrollbars": "^4.2.1",
        "react-dates": "^19.0.0",
        "react-dom": "^16.5.1",
        "react-facebook-pixel": "^0.1.3",
        "react-fade-in": "0.1.6",
        "react-ga": "^2.5.7",
        "react-gtm-module": "^2.0.7",
        "react-infinite-scroller": "^1.2.4",
        "react-lazy-load-image-component": "^1.3.2",
        "react-maskedinput": "^4.0.1",
        "react-notify-toast": "^0.5.0",
        "react-overlay-loader": "^0.0.3",
        "react-progressive-image": "^0.6.0",
        "react-redux": "^5.0.7",
        "react-router": "^4.3.1",
        "react-router-dom": "^4.3.1",
        "react-router-redux": "^4.0.8",
        "react-scrollspy": "^3.3.5",
        "react-slick": "^0.23.2",
        "react-tabs": "^2.3.0",
        "react-transition-group": "1.x",
        "reactjs-popup": "^1.3.1",
        "redux": "^4.0.0",
        "redux-actions": "^2.6.1",
        "redux-persist": "^5.10.0",
        "redux-thunk": "^2.3.0",
        "rimraf": "^2.6.2",
        "shared": "^2.0.0",
        "slick-carousel": "^1.8.1",
        "underscore": "^1.9.1",
        "url-loader": "^1.1.1",
        "uuid": "^3.3.3",
        "webpack-bundle-analyzer": "^3.0.2",
        "webpack-pwa-manifest": "^3.6.2"
      },
      "browserslist": [
        "last 4 version",
        "> 1%"
      ],
     "devDependencies": {
        "@babel/cli": "^7.1.0",
        "@babel/core": "^7.1.0",
        "@babel/plugin-proposal-class-properties": "^7.1.0",
        "@babel/plugin-transform-runtime": "^7.1.0",
        "@babel/preset-env": "^7.1.0",
        "@babel/preset-react": "^7.0.0",
        "axios-mock-adapter": "^1.15.0",
        "babel-core": "^7.0.0-bridge.0",
        "babel-eslint": "9.0.0",
        "babel-jest": "^23.6.0",
        "babel-plugin-transform-runtime": "6.23.0",
        "babel-preset-env": "1.6.1",
        "babel-preset-react": "6.24.1",
        "babel-preset-stage-2": "6.24.1",
        "babel-runtime": "6.26.0",
        "eslint": "^5.6.0",
        "eslint-config-airbnb": "^17.1.0",
        "eslint-plugin-import": "^2.14.0",
        "eslint-plugin-jsx-a11y": "^6.1.1",
        "eslint-plugin-react": "^7.11.1",
        "husky": "^0.14.3",
        "jest": "^23.6.0"
      }
    ...
    }
    I tried changing the version of nextjs7 to 9, but facing lot of issues of babel and others
    So, if you guys can help me out
    it would be great
    子慕大诗人
    @zimv
    @ravi-mone Maybe you can create a new nextjs9 project and copy from your old codes to new's project.
    ROne
    @ravi-mone
    thanks for replay bro
    I am trying the same way
    MyApp - is my new project
    Getting this error : Class constructor App cannot be invoked without 'new' at new AppWrapper
    googled it, no answer is fixing my issue
    子慕大诗人
    @zimv
    @ravi-mone Give us the error message
    tiger_yan
    @Tiger-Yan
    官方示例说是:Link组件内部包含 非 a 元素时,只会处理 onClick 事件,不会进行 路由跳转。 不过,写出来的demo ,Link无论时包含div,或img,无论是否提供 onClick 事件, 结果都会进行路由跳转呢。
    iceRao
    @raoenhui
    谢谢你的问题,这句话我需要改下
    iceRao
    @raoenhui
    @Tiger-Yan <Link>支持任何有onClick事件的组件。 如果你不包含<a>,它将仅添加onClick事件,并且不会给组件加href属性。
    zzbxiii
    @zzbxiii
    The resource http://localhost:3180/_next/static/SDStZ3syAnJKR4AiSaSgE/pages/about.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
    报这个问题 要怎么解决
    renyi
    @gitCoy
    hello,我遇到一个问题,很急,在线等。如下:
    我请求接口需要在请求里面携带一个header,但是nextjs 服务端和本地发送的请求需要携带同一个参数,怎么在next和本地公用参数呢
    不知道我表述明白没有
    tiger_yan
    @Tiger-Yan
    部署的时候一定要 和整个项目一起部署么?
    如果 只部署 build 后的 .next 文件呢,