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

Update next-transpile-modules.js #293

Closed
wants to merge 4 commits into from

Conversation

mkstayalive
Copy link

Fixing the following error

TypeError: config.watchOptions.ignored.filter is not a function or its return value is not iterable
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/next-transpile-modules/src/next-transpile-modules.js:265:42)
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/next-fonts/index.js:42:27)
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/next-images/index.js:63:27)
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/@expo/next-adapter/build/index.js:39:35)
    at getBaseWebpackConfig (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/build/webpack-config.js:2147:32)
    at async Promise.all (index 0)
    at async Span.traceAsyncFn (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/trace/trace.js:103:20)
    at async Span.traceAsyncFn (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/trace/trace.js:103:20)
    at async HotReloader.start (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/dev/hot-reloader.js:573:30)
    at async DevServer.prepareImpl (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/dev/next-dev-server.js:685:9)
    at async NextServer.prepare (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/next.js:165:13)
    at async Server.<anonymous> (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/lib/render-server.js:136:17) {
  type: 'TypeError'
}

Fixing the following error

```
TypeError: config.watchOptions.ignored.filter is not a function or its return value is not iterable
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/next-transpile-modules/src/next-transpile-modules.js:265:42)
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/next-fonts/index.js:42:27)
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/next-images/index.js:63:27)
    at Object.webpack (/Users/manish/projects/kripaluras-rn/node_modules/@expo/next-adapter/build/index.js:39:35)
    at getBaseWebpackConfig (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/build/webpack-config.js:2147:32)
    at async Promise.all (index 0)
    at async Span.traceAsyncFn (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/trace/trace.js:103:20)
    at async Span.traceAsyncFn (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/trace/trace.js:103:20)
    at async HotReloader.start (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/dev/hot-reloader.js:573:30)
    at async DevServer.prepareImpl (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/dev/next-dev-server.js:685:9)
    at async NextServer.prepare (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/next.js:165:13)
    at async Server.<anonymous> (/Users/manish/projects/kripaluras-rn/node_modules/next/dist/server/lib/render-server.js:136:17) {
  type: 'TypeError'
}

```
@martpie
Copy link
Owner

martpie commented Jul 23, 2023

Hey, thank you very much for that! Can you update the tests to make sure it works?

In scripts/next-update.sh, change NEXT_VERSION to the latest version, run the script, and it should update next.js in all the test apps :)

@mkstayalive
Copy link
Author

@martpie I have updated the Next.js version. However I would need help with the tests.

The config.watchOptions.ignored was a regex instead of an array, that's why it was failing:

config.watchOptions {
  aggregateTimeout: 5,
  ignored: /^((?:[^/]*(?:\/|$))*)(\.(git|next)|node_modules)(\/((?:[^/]*(?:\/|$))*)(?:$|\/))?/
}

@martpie
Copy link
Owner

martpie commented Jul 23, 2023

Just run the script bash scripts/next-update.sh, then push the files here, GitHub Actions will run the tests :) (you will need npm and yarn installed)

@mkstayalive
Copy link
Author

There seems to be some issue with resolving the version of shared-ui. Although I can see the version mentioned is 1.0.0, it is still unable to find.

Screen Shot 2023-07-23 at 6 34 26 PM

sh scripts/next-update.sh
==================== NPM ====================

changed 3 packages, and audited 48 packages in 2s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
==================== PNPM ====================
scripts/next-update.sh: line 11: pnpm: command not found
==================== YARN WORKSPACES ====================
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
Couldn't find any versions for "shared-ui" that matches "^1.0.0"
? Please choose a version of "shared-ui" from this list: (Use arrow keys)
❯ 0.0.8 
? Please choose a version of "shared" from this list: 0.2.0
warning workspace-aggregator-cdb0fa14-158c-4aa9-ab6a-e48cb47ff23b > test-yarn-workspaces > shared > node-uuid@1.3.3: Use uuid module instead
warning workspace-aggregator-cdb0fa14-158c-4aa9-ab6a-e48cb47ff23b > test-yarn-workspaces > shared > bson@0.1.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
warning workspace-aggregator-cdb0fa14-158c-4aa9-ab6a-e48cb47ff23b > test-yarn-workspaces > shared > mongodb@1.2.14: Please upgrade to 2.2.19 or higher
warning workspace-aggregator-cdb0fa14-158c-4aa9-ab6a-e48cb47ff23b > test-yarn-workspaces > shared > mongodb > bson@0.1.8: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
error Received malformed response from registry for "shared-ts". The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
==================== YARN WORKSPACES SYMLINKS ====================
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
Couldn't find any versions for "shared-ui" that matches "^1.0.0"
? Please choose a version of "shared-ui" from this list: (Use arrow keys)
❯ 0.0.8 
? Please choose a version of "shared" from this list: 0.2.0
warning workspace-aggregator-13f4cbb5-a78c-455f-bfde-72ce390741c4 > test-yarn-workspaces > shared > node-uuid@1.3.3: Use uuid module instead
warning workspace-aggregator-13f4cbb5-a78c-455f-bfde-72ce390741c4 > test-yarn-workspaces > shared > bson@0.1.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
warning workspace-aggregator-13f4cbb5-a78c-455f-bfde-72ce390741c4 > test-yarn-workspaces > shared > mongodb@1.2.14: Please upgrade to 2.2.19 or higher
warning workspace-aggregator-13f4cbb5-a78c-455f-bfde-72ce390741c4 > test-yarn-workspaces > shared > mongodb > bson@0.1.8: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
error Received malformed response from registry for "shared-ts". The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
==================== SWC ====================
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
Couldn't find any versions for "shared" that matches "^1.0.0"
? Please choose a version of "shared" from this list: (Use arrow keys)
Couldn't find any versions for "shared-ui" that matches "^1.0.0"
? Please choose a version of "shared-ui" from this list: 0.0.8
warning workspace-aggregator-9a3f3c96-0137-4268-a54e-26f0c3767095 > test-yarn-workspaces > shared > bson@0.1.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
warning workspace-aggregator-9a3f3c96-0137-4268-a54e-26f0c3767095 > test-yarn-workspaces > shared > mongodb@1.2.14: Please upgrade to 2.2.19 or higher
warning workspace-aggregator-9a3f3c96-0137-4268-a54e-26f0c3767095 > test-yarn-workspaces > shared > mongodb > bson@0.1.8: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
warning workspace-aggregator-9a3f3c96-0137-4268-a54e-26f0c3767095 > test-yarn-workspaces > shared > node-uuid@1.3.3: Use uuid module instead
error Received malformed response from registry for "shared-ts". The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
==================== WITH-APP-DIR ====================
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
Couldn't find any versions for "shared" that matches "^1.0.0"
? Please choose a version of "shared" from this list: (Use arrow keys)
Couldn't find any versions for "shared-ui" that matches "^1.0.0"
? Please choose a version of "shared-ui" from this list: 0.0.8
warning workspace-aggregator-1c5dc7a2-bb0f-45ec-81ab-0867b210fa52 > test-yarn-workspaces > shared > bson@0.1.9: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
warning workspace-aggregator-1c5dc7a2-bb0f-45ec-81ab-0867b210fa52 > test-yarn-workspaces > shared > node-uuid@1.3.3: Use uuid module instead
warning workspace-aggregator-1c5dc7a2-bb0f-45ec-81ab-0867b210fa52 > test-yarn-workspaces > shared > mongodb@1.2.14: Please upgrade to 2.2.19 or higher
warning workspace-aggregator-1c5dc7a2-bb0f-45ec-81ab-0867b210fa52 > test-yarn-workspaces > shared > mongodb > bson@0.1.8: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
error Received malformed response from registry for "shared-ts". The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@martpie
Copy link
Owner

martpie commented Jul 23, 2023

Oh sorry I forgot, please run yarn setup before! Then the script.

@martpie
Copy link
Owner

martpie commented Jul 23, 2023

(I should definitely add that to the README)

@mkstayalive
Copy link
Author

@martpie thanks for the help. I was able to push the updates.

@martpie
Copy link
Owner

martpie commented Jul 24, 2023

Took over in #294 :)

@martpie martpie closed this Jul 24, 2023
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

2 participants