Skip to content

Conversation

brandonlenz
Copy link
Contributor

Summary

There seems to be issues for consumers of the library dating back to 8.0.0 (we were able to replicated it as early as this release)

Related Issues or PRs

Attempts to fix: #3159

How To Test

Honestly, not sure. This seems to have been an issue for a little while (since version 8.0.0)

I didn't see this locally pointing to the package on my machine before publish, but not sure that means much.

Might need to release and re-test until we can figure it out

Screenshots (optional)

@brandonlenz brandonlenz changed the title Fix import issues post release fix(release): Fix import issues post release May 16, 2025
@@ -12,8 +12,7 @@
"component library"
],
"type": "module",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
"main": "./lib/index.d.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So @ronaktruss has pointed out that I probably am wrong about this 😅

@@ -12,8 +12,7 @@
"component library"
],
"type": "module",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lots of info is pointing to this key being a problem, but there is some documentation about it here:

https://esbuild.github.io/api/#main-fields

@brandonlenz brandonlenz marked this pull request as draft May 16, 2025 20:45
@brandonlenz
Copy link
Contributor Author

@jpandersen87 have you been successfully using React USWDS > 8.0.0 since the Vite migration?

I suspect the project we're seeing issues on might need to update project configs.

We're now also seeing:

✘ [ERROR] Missing "./lib/index.css" specifier in "@trussworks/react-uswds" package [plugin vite:dep-scan]

    src/App.tsx:39:7:
      39 │ import '@trussworks/react-uswds/lib/index.css';

@brandonlenz
Copy link
Contributor Author

Looks like the .tgz generated by our package-release job is empty. Does not have a lib directory.

That's likely the issue. Need to verify which yarn scripts are needed to run on Yarn v3 to generate a release

@brandonlenz brandonlenz deleted the 3159-fix-import-issues-post-release branch May 16, 2025 21:27
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.

[fix] v10.0 causes error for import statements: "Cannot find module '@trussworks/react-uswds' or its corresponding type declarations."
1 participant