Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'next-i18next') #2093

Closed
kounetsuman opened this issue Nov 21, 2021 · 2 comments
Closed

Comments

@kounetsuman
Copy link

kounetsuman commented Nov 21, 2021

Issue Summary

Since the contents of #2070 had occurred, when I upgraded the version of @sls-next/[email protected] , this error occurred.
next-i18next is not used and ./next-i18next.config.js does not exist.
It also doesn't implement localization.

I hope that the information of those who are in the same state will be posted.

Actual behavior

Expected behavior

Steps to reproduce

Screenshots/Code/Configuration/Logs

console log

$ node --version
v16.13.0
$ npx next --version
Next.js v12.0.4
$ npx serverless --stage=production

  error:
  TypeError: Cannot read properties of undefined (reading 'next-i18next')
    at NextI18nextIntegration.isPackagePresent (/root/.serverless/components/registry/npm/@sls-next/[email protected]/node_modules/@sls-next/core/dist/build/third-party/integration-base.js:22:46)
    at async NextI18nextIntegration.execute (/root/.serverless/components/registry/npm/@sls-next/[email protected]/node_modules/@sls-next/core/dist/build/third-party/next-i18next.js:15:13)
    at async Promise.all (index 1)
    at async Builder.runThirdPartyIntegrations (/root/.serverless/components/registry/npm/@sls-next/[email protected]/node_modules/@sls-next/lambda-at-edge/dist/build.js:430:9)
    at async Promise.all (index 9)
    at async Builder.build (/root/.serverless/components/registry/npm/@sls-next/[email protected]/node_modules/@sls-next/lambda-at-edge/dist/build.js:406:9)
    at async NextjsComponent.build (/root/.serverless/components/registry/npm/@sls-next/[email protected]/node_modules/@sls-next/serverless-component/dist/component.js:165:13)
    at async NextjsComponent.default (/root/.serverless/components/registry/npm/@sls-next/[email protected]/node_modules/@sls-next/serverless-component/dist/component.js:22:13)
    at async fn (/workspace/node_modules/@serverless/template/utils.js:280:41)
    at async Promise.all (index 0)

./serverless.yml

myApp:
  component: "@sls-next/[email protected]"
  inputs:
    bucketName: ${env.AWS_S3_NAME}
    domain: ${env.NEXT_PUBLIC_MYDOMAIN}
    cloudfront:
      distributionId: ${env.AWS_CLOUDFRONT_NAME}
    certificate:
        cloudFrontDefaultCertificate: false
        acmCertificateArn: ${env.AWS_ACM}
    name: ${env.AWS_LAMBDA_NAME}

./Dockerfile

FROM node:16.13.0

RUN apt-get update
RUN apt-get install git curl vim -y
RUN apt-get clean
RUN curl -o- -L https://yarnpkg.com/install.sh | sh
RUN yarn install

EXPOSE 5000

./package.json # only devDependencies

"devDependencies": {
    "@fullhuman/postcss-purgecss": "^4.0.3",
    "@hookform/resolvers": "1.3.0 because of https://github.com/react-hook-form/resolvers/issues/100",
    "@material-ui/core": "^4.11.3",
    "@material-ui/icons": "^4.11.2",
    "@serverless/aws-cloudfront": "^6.0.0",
    "@serverless/aws-lambda": "^3.0.3",
    "@serverless/aws-s3": "^4.2.0",
    "@serverless/domain": "^6.1.0",
    "@types/enzyme-adapter-react-16": "^1.0.6",
    "@types/gtag.js": "^0.0.7",
    "@types/jest": "^26.0.20",
    "@types/marked": "^1.2.0",
    "@types/node": "^14.14.9",
    "@types/react": "^17.0.0",
    "@types/react-test-renderer": "^17.0.1",
    "@types/rss": "^0.0.28",
    "@types/styled-components": "^5.1.7",
    "@types/yup": "^0.29.11",
    "@typescript-eslint/eslint-plugin": "^5.2.0",
    "@typescript-eslint/parser": "^5.2.0",
    "babel-plugin-inline-react-svg": "^1.1.2",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "cssnano": "^5.0.1",
    "date-fns": "^2.16.1",
    "dotenv": "^8.2.0",
    "enzyme": "^3.11.0",
    "enzyme-adapter-react-16": "^1.15.6",
    "enzyme-to-json": "^3.6.1",
    "eslint": "^7.32.0",
    "eslint-config-next": "^11.0.1",
    "eslint-config-prettier": "^6.15.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-react": "^7.26.1",
    "eslint-plugin-react-hooks": "^4.2.0",
    "gray-matter": "^4.0.3",
    "jest": "^26.6.3",
    "marked": "^4.0.4",
    "next": "^12.0.4",
    "next-pwa": "^5.2.14",
    "postcss-flexbugs-fixes": "^5.0.2",
    "postcss-preset-env": "^6.7.0",
    "prettier": "^2.4.1",
    "pretty-quick": "^3.1.0",
    "raw-loader": "^4.0.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-hook-form": "^6.15.1",
    "react-test-renderer": "^17.0.1",
    "rss": "^1.2.2",
    "serverless": "^2.66.2",
    "styled-components": "^5.3.1",
    "stylelint": "^13.8.0",
    "stylelint-config-recommended": "^3.0.0",
    "stylelint-config-standard": "^20.0.0",
    "tailwindcss": "^2.2.15",
    "ts-jest": "^26.5.3",
    "typescript": "^4.5.2",
    "webpack": "^5.64.2",
    "webpack-cli": "^4.9.1",
    "yup": "^0.32.8"
  }
@dphang
Copy link
Collaborator

dphang commented Nov 21, 2021

Looks like if you don't have dependencies block then it fails. I'll add a fix to check for it

@dphang
Copy link
Collaborator

dphang commented Nov 21, 2021

Fixed in #2094

@dphang dphang closed this as completed Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants