OfficeDev / microsoft-teams-library-js

JavaScript library for use by Microsoft Teams apps
https://docs.microsoft.com/microsoftteams/platform/
Other
434 stars 198 forks source link

TypeError: Cannot set properties of undefined (setting 'microsoftTeams') #2605

Closed didemkkaslan closed 1 week ago

didemkkaslan commented 2 weeks ago

Hello, I'm suddenly getting an error: TypeError: Cannot set properties of undefined (setting 'microsoftTeams') after upgrading to nextjs 14.2.16 but I haven't change anything related to microsoft teams package

Screenshot 2024-11-07 at 13 21 54

Package.json

{
  "name": "platform-v2",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "sync-translations": "node ./scripts/sync-translations.js",
    "dev": "next dev",
    "build": "node ./scripts/sync-translations.js && next build",
    "start": "next start",
    "lint": "next lint",
    "prepare": "husky install",
    "test": "jest",
    "codegen": "graphql-codegen --config codegen.ts"
  },
  "dependencies": {
    "@amplitude/analytics-browser": "^2.3.3",
    "@ant-design/cssinjs": "1.20.0",
    "@ant-design/icons": "^5.2.6",
    "@ant-design/plots": "1.2.5",
    "@aws-amplify/adapter-nextjs": "^1.2.23",
    "@azure/msal-browser": "^3.24.0",
    "@azure/msal-react": "^2.1.0",
    "@ckeditor/ckeditor5-build-classic": "^43.3.0",
    "@ckeditor/ckeditor5-react": "^9.3.1",
    "@mantine/hooks": "^7.1.5",
    "@microsoft/teams-js": "2.30.0",
    "@react-pdf/renderer": "^3.1.13",
    "@tanstack/react-query": "^5.0.5",
    "@tanstack/react-query-devtools": "^5.8.9",
    "@types/react-highlight-words": "^0.16.6",
    "@types/uuid": "^9.0.7",
    "antd": "5.17.0",
    "apexcharts": "^3.44.0",
    "aws-amplify": "^6.6.4",
    "aws-rum-web": "^1.15.0",
    "axios": "^1.5.1",
    "clsx": "^2.0.0",
    "cookies-next": "^4.3.0",
    "dayjs": "^1.11.10",
    "docx": "^8.5.0",
    "framer-motion": "^11.11.11",
    "graphql": "^16.9.0",
    "graphql-request": "6.1.0",
    "i18next": "^23.7.15",
    "i18next-chained-backend": "^4.5.0",
    "i18next-http-backend": "^2.2.2",
    "i18next-localstorage-backend": "^4.2.0",
    "jwt-decode": "^3.1.2",
    "lodash": "^4.17.21",
    "next": "14.2.16",
    "next-i18next": "^15.1.2",
    "next-seo": "^6.1.0",
    "react": "^18.3.1",
    "react-apexcharts": "^1.4.1",
    "react-dom": "^18.3.1",
    "react-error-boundary": "^4.0.13",
    "react-google-recaptcha": "^3.1.0",
    "react-highlight-words": "^0.20.0",
    "react-i18next": "^14.0.0",
    "react-icons": "^4.11.0",
    "react-infinite-scroll-component": "^6.1.0",
    "react-markdown": "^9.0.1",
    "react-quill": "^2.0.0",
    "rehype-raw": "^7.0.0",
    "remark-gfm": "^4.0.0",
    "tailwind-merge": "^1.14.0",
    "usehooks-ts": "^2.9.1",
    "uuid": "^9.0.1",
    "zod": "^3.22.4",
    "zustand": "^4.5.2"
  },
  "devDependencies": {
    "@graphql-codegen/cli": "^5.0.3",
    "@graphql-codegen/client-preset": "^4.4.0",
    "@graphql-codegen/introspection": "^4.0.3",
    "@next/bundle-analyzer": "15.0.2",
    "@tailwindcss/typography": "^0.5.10",
    "@testing-library/jest-dom": "^6.1.4",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.5.1",
    "@types/jest": "^29.5.6",
    "@types/lodash": "^4.14.200",
    "@types/mixpanel-browser": "^2.47.4",
    "@types/node": "^20.8.8",
    "@types/react": "^18.3.12",
    "@types/react-dom": "^18.3.1",
    "@types/react-google-recaptcha": "^2.1.7",
    "@typescript-eslint/eslint-plugin": "^8.13.0",
    "@typescript-eslint/parser": "^8.13.0",
    "autoprefixer": "^10.4.16",
    "eslint": "^8.52.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-airbnb-typescript": "^17.1.0",
    "eslint-config-next": "15.0.2",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-i18next": "^6.0.3",
    "eslint-plugin-import": "^2.29.0",
    "eslint-plugin-jest": "^27.4.3",
    "eslint-plugin-jest-dom": "^5.1.0",
    "eslint-plugin-jsx-a11y": "^6.7.1",
    "eslint-plugin-react": "^7.33.2",
    "eslint-plugin-testing-library": "^6.1.2",
    "husky": "^8.0.3",
    "jest": "^29.7.0",
    "jest-environment-jsdom": "^29.7.0",
    "mixpanel-browser": "^2.47.0",
    "postcss": "^8.4.31",
    "prettier": "^3.0.3",
    "prettier-plugin-tailwindcss": "^0.5.6",
    "sharp": "^0.32.6",
    "tailwindcss": "^3.3.3",
    "typescript": "^5.2.2"
  },
  "resolutions": {
    "dset": "^3.1.4"
  }
}
microsoft-github-policy-service[bot] commented 2 weeks ago

Hi didemkkaslan! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

noahdarveau-MSFT commented 2 weeks ago

Hi @didemkkaslan, could you please tell us which version of nextjs you upgraded from. Also, just to clarify, while you mentioned you didn't make any changes around the teams-js package, did you update the teams-js version at the same time as updating the nextjs version, or was everything working with 2.30.0 prior to upgrading the nextjs version? Thanks!

noahdarveau-MSFT commented 1 week ago

Hello, @didemkkaslan, I published a new teams-js beta release, 2.31.0-beta.2, with a fix for your issue. Feel free to update to it and try it out. The next major release that will contain the fix is expected to come out later this week. I'm going to close this issue for now, if you are still encountering the issue after upgrading to the new version, feel free to re-open this thread.

microsoft-github-policy-service[bot] commented 1 week ago

Tell us about your experience!

Hi didemkkaslan! We have closed this issue in our system, but we would love to hear your feedback. To let us know how we did, simply use one of the following emoji icons: :thumbsup: for resolved, :thumbsdown: for unresolved, or :heart: for a great experience on this message. Please use the link for more detailed feedback.

Best regards, Teams Platform