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

feat(deps): update typescript to v5.3.3 #78

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

lluiscab
Copy link
Contributor

@lluiscab lluiscab commented Dec 17, 2023

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

This PR updates the typescript dependency to 5.3.3, the latest version available of TypeScript.

What changes did you make? (Give an overview)

I've updated src/utils.ts to the new API. All tests are passing locally.

@aralroca aralroca self-requested a review April 29, 2024 21:26
Copy link
Owner

@aralroca aralroca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, thanks for your contribution @lluiscab ! thanks for your comment @kristian240 , LGTM! thanks!

@aralroca aralroca merged commit c9087bd into aralroca:main Apr 29, 2024
@kristian240
Copy link

@aralroca is it possible to get a new release with this changes?

@lluiscab lluiscab deleted the feat/deps/ts-5 branch April 29, 2024 21:36
@lluiscab
Copy link
Contributor Author

Hi @aralroca, really awesome to fially see this PR merged. Could you also take a look at #79?

I could also open a PR to update to typescript@5.4.5 if needed / welcome.

@aralroca
Copy link
Owner

@aralroca
Copy link
Owner

I see that now the pages example is broken, so probably we need to do more adaptations for the TypeScript parser migration:

Screenshot 2024-04-30 at 00 19 35

@lluiscab
Copy link
Contributor Author

I'll try and see if I can take a look today.

@kristian240
Copy link

Any update on this one?

@lluiscab
Copy link
Contributor Author

@aralroca I've just executed next-translate/examples/complex with next-translate-plugin@3.0.0-canary.4 and it seems to be working correctly. Do you have a reproduction?
image

@kristian240
Copy link

Hey 👋🏼 !

Seems like this works on my end with 3.0.0-canary.4 however I needed to leave next-translate@2.6.2.

I have monorepo managed by yarn and with next-translate@3.0.0-canary.3 I was getting errors on build and dev

# BUILD

 ⚠ Linting is disabled
   ▲ Next.js 14.1.4
   - Environments: .env
   - Experiments (use at your own risk):
     · typedRoutes

   Creating an optimized production build ...
Failed to compile.

./node_modules/next/dist/pages/_app.js
Module not found: Can't resolve 'next-translate/appWithI18n'

https://nextjs.org/docs/messages/module-not-found

./src/services/i18n/TypeSafeTrans.tsx
Module not found: Can't resolve 'next-translate/Trans'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./src/ui/components/atoms/Toast/ToastStand.tsx

./src/services/i18n/hooks/use-type-safe-translation.ts
Module not found: Can't resolve 'next-translate/useTranslation'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
./src/ui/components/organisms/CookiePolicy.tsx

./src/app/(index)/page.tsx
Module not found: Can't resolve 'next-translate/AppDirI18nProvider'

https://nextjs.org/docs/messages/module-not-found

./src/app/(index)/page.tsx
Module not found: Can't resolve 'next-translate/loadNamespaces'

https://nextjs.org/docs/messages/module-not-found


> Build failed because of webpack errors
# DEV
 ✓ Compiled /src/middleware in 222ms (90 modules)
 ○ Compiling /trade ...
 ⨯ ./src/app/global-error.tsx:6:2
Module not found: Can't resolve 'next-translate/loadNamespaces'
  4 |   import { useSearchParams as __useSearchParams, useParams as __useParams } from 'next/navigation'
  5 |   import { use as __use, Suspense as __Suspense } from 'react'
> 6 |   import __loadNamespaces from 'next-translate/loadNamespaces'
    |  ^
  7 |
  8 |   ;
  9 | import { captureException } from '@sentry/nextjs';

https://nextjs.org/docs/messages/module-not-found
[HPM] GET /backend-api/user/me -> https://stg.my-app.com
 ⨯ ./src/app/global-error.tsx:6:2
Module not found: Can't resolve 'next-translate/loadNamespaces'
  4 |   import { useSearchParams as __useSearchParams, useParams as __useParams } from 'next/navigation'
  5 |   import { use as __use, Suspense as __Suspense } from 'react'
> 6 |   import __loadNamespaces from 'next-translate/loadNamespaces'
    |  ^
  7 |
  8 |   ;
  9 | import { captureException } from '@sentry/nextjs';

https://nextjs.org/docs/messages/module-not-found
 ⨯ ./src/app/global-error.tsx:6:2
Module not found: Can't resolve 'next-translate/loadNamespaces'
  4 |   import { useSearchParams as __useSearchParams, useParams as __useParams } from 'next/navigation'
  5 |   import { use as __use, Suspense as __Suspense } from 'react'
> 6 |   import __loadNamespaces from 'next-translate/loadNamespaces'
    |  ^
  7 |
  8 |   ;
  9 | import { captureException } from '@sentry/nextjs';

https://nextjs.org/docs/messages/module-not-found
 ⨯ ./node_modules/next/dist/pages/_app.js:16:20
Module not found: Can't resolve 'next-translate/appWithI18n'

https://nextjs.org/docs/messages/module-not-found
 ⨯ Error: ENOENT: no such file or directory, open '/Users/kristiandjakovic/work/my-app/apps/frontend/web/.next/fallback-build-manifest.json'
    at readFileSync (node:fs:453:20)
    at loadManifest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-manifest.js:35:54)
    at loadManifestWithRetries (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-components.js:40:51)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processTimers (node:internal/timers:511:9)
    at async loadDefaultErrorComponentsImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-default-error-components.js:30:24)
    at async DevServer.getFallbackErrorComponents (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:582:16)
    at async DevServer.renderErrorToResponseImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:2123:40)
    at async DevServer.pipeImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:895:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/next-server.js:228:21)
    at async DevServer.handleRequestImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:791:17)
    at async /Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:331:20
    at async Span.traceAsyncFn (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/trace/trace.js:151:20)
    at async DevServer.handleRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:328:24)
    at async invokeRender (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:174:21)
    at async handleRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:353:24)
    at async NextCustomServer.requestHandlerImpl [as requestHandler] (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:377:13) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/kristiandjakovic/work/my-app/apps/frontend/web/.next/fallback-build-manifest.json'
}
Error: ENOENT: no such file or directory, open '/Users/kristiandjakovic/work/my-app/apps/frontend/web/.next/fallback-build-manifest.json'
    at readFileSync (node:fs:453:20)
    at loadManifest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-manifest.js:35:54)
    at loadManifestWithRetries (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-components.js:40:51)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processTimers (node:internal/timers:511:9)
    at async loadDefaultErrorComponentsImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-default-error-components.js:30:24)
    at async DevServer.getFallbackErrorComponents (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:582:16)
    at async DevServer.renderErrorToResponseImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:2123:40)
    at async DevServer.pipeImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:895:25)
    at async NextNodeServer.handleCatchallRenderRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/next-server.js:228:21)
    at async DevServer.handleRequestImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:791:17)
    at async /Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:331:20
    at async Span.traceAsyncFn (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/trace/trace.js:151:20)
    at async DevServer.handleRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:328:24)
    at async invokeRender (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:174:21)
    at async handleRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:353:24)
    at async NextCustomServer.requestHandlerImpl [as requestHandler] (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:377:13) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/kristiandjakovic/work/my-app/apps/frontend/web/.next/fallback-build-manifest.json'
}
Error: ENOENT: no such file or directory, open '/Users/kristiandjakovic/work/my-app/apps/frontend/web/.next/fallback-build-manifest.json'
    at readFileSync (node:fs:453:20)
    at loadManifest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-manifest.js:35:54)
    at loadManifestWithRetries (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-components.js:40:51)
    at async loadDefaultErrorComponentsImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/load-default-error-components.js:30:24)
    at async DevServer.getFallbackErrorComponents (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:582:16)
    at async DevServer.renderErrorToResponseImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:2123:40)
    at async pipe.req.req (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:1976:30)
    at async DevServer.pipeImpl (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/base-server.js:895:25)
    at async /Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:331:20
    at async Span.traceAsyncFn (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/trace/trace.js:151:20)
    at async DevServer.handleRequest (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/dev/next-dev-server.js:328:24)
    at async invokeRender (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:174:21)
    at async NextCustomServer.requestHandlerImpl [as requestHandler] (/Users/kristiandjakovic/work/my-app/apps/frontend/web/node_modules/next/dist/server/lib/router-server.js:389:24) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/kristiandjakovic/work/my-app/apps/frontend/web/.next/fallback-build-manifest.json'
}

@kristian240
Copy link

Should I/we create a new issue for this?

@aralroca
Copy link
Owner

@aralroca I've just executed next-translate/examples/complex with next-translate-plugin@3.0.0-canary.4 and it seems to be working correctly. Do you have a reproduction? image

Nothing special, just update the dependency and run yarn example:complex, it's like it's taking the _default language. I have tried it in both master and canary branch, it happens in both. Do you have the updated branch? it is not some new change from the 3.0.0 version we are working on.

Screenshot 2024-05-14 at 21 33 35

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

Successfully merging this pull request may close these issues.

None yet

3 participants