Skip to content

Fix Patternfly example to not use deprecated techniques #20916

@willieseabrook

Description

@willieseabrook

What example does this report relate to?

with-patternfly

What version of Next.js are you using?

10.0.4

What version of Node.js are you using?

14.15.4

What browser are you using?

Chrome (all, not browser related)

What operating system are you using?

Linux

How are you deploying your application?

yarn run dev

Describe the Bug

Patternfly is becoming very, very popular, and there's quite a few bug/issue reports scattered around of people fighting to get it to work with Nextjs

Unfortunately, the Patternfly example https://github.com/vercel/next.js/tree/canary/examples/with-patternfly uses deprecated techniques:

  • @zeit/next-css which is deprecated and removed from repository. Running this example now gives a warning and will probably soon fail as nextjs development continues
  • It uses an old next-transpile-modules version 4.1.0 where latest is 6.0.0
  • And while the current example doesn't use it, the only way to get SASS working is with the also deprecated and removed @zeit/next-sass module, which in turn will only work with the deprecated node-sass module when used with Patternfly (See my issue filed to dart-sass at Nextjs + Patternfly react table head + using legacy node-sass works, but using dart-sass fails sass/dart-sass#1186 )

Expected Behavior

Update the Patternfly example to use supported techniques and/or an updated workaround.

I have a repo at https://github.com/willieseabrook/nextjs-with-patternfly which at least uses the latest version of https://github.com/martpie/next-transpile-modules

Note, that solving this for Patternfly will be very valuable for the wider community, as the reason the with-patternfly example is complicated is because Patternfly includes css files in its JS files in the node_modules directory.

In various issues I've found, the Nextjs team has expressly prohibited doing this as a (very very good) design decision, so that will not change.

However, it would be nice to have a standard workaround, using Patternfly as an example, for people who have no other choice - I can't control Patternfly and this breaks quite a few other React modules (hence the various scattered issues on this topic)

Without a new standard workaround, Patternfly would need to be considered expressly incompatible with Nextjs and therefore need to be removed from the examples repository.

To Reproduce

Try to run the example at https://github.com/vercel/next.js/tree/canary/examples/with-patternfly

Metadata

Metadata

Assignees

Labels

examplesIssue was opened via the examples template.good first issueEasy to fix issues, good for newcomersplease verify canaryPlease verify the issue with the latest canary branch.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions