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

Fixed build script by upgrading rollup-plugin-typescript2 to latest #4256

Merged
merged 4 commits into from
Jan 9, 2022
Merged

Fixed build script by upgrading rollup-plugin-typescript2 to latest #4256

merged 4 commits into from
Jan 9, 2022

Conversation

mxweaver
Copy link
Contributor

@mxweaver mxweaver commented Jan 9, 2022

Howdy! When I tried to run npm build, I was seeing the following error:

madison ~/projects/redux 
489 ߷  npm run build                     

> [email protected] build
> rollup -c

Error loading `tslib` helper library.
[!] Error: Package subpath './package.json' is not defined by "exports" in /Users/madison/projects/redux/node_modules/tslib/package.json
Error: Package subpath './package.json' is not defined by "exports" in /Users/madison/projects/redux/node_modules/tslib/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/madison/projects/redux/node_modules/rollup-plugin-typescript2/src/tslib.ts:11:23)

It seems like rollup-plugin-typescript2 is trying to access a file that's not exported by tslib. My first attempt at solving it was to update the rollup-plugin-typescript2 package to see if they fixed the issue and it worked!

madison ~/projects/redux 
493 ߷  npm run build                               

> [email protected] build
> rollup -c


src/index.ts → lib/redux.js...
created lib/redux.js in 3.4s

src/index.ts → es/redux.js...
created es/redux.js in 2s

src/index.ts → es/redux.mjs...
created es/redux.mjs in 2.4s

src/index.ts → dist/redux.js...
created dist/redux.js in 1.5s

src/index.ts → dist/redux.min.js...
created dist/redux.min.js in 2.1s

Changelog

  • Fixed a build error by upgrading rollup-plugin-typescript2 to version 0.31.1

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 9, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ee311d2:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration

@markerikson
Copy link
Contributor

And of course this PR has a conflict now that I merged the ESLint PR.

Could you rebase/merge and resolve that conflict?

@markerikson
Copy link
Contributor

sigh naturally I shoulda run the build checks on the docs PR too :)

There were a couple of formatting/spacing issues with the applyMiddleware/bindActionCreators docs updates. Could you do me a favor, merge master into this branch, and then re-run Prettier to make sure everything's formatted right?

Thank you!

@mxweaver mxweaver changed the title fixed build script by upgrading rollup-plugin-typescript2 to latest Fixed build script by upgrading rollup-plugin-typescript2 to latest Jan 9, 2022
@mxweaver
Copy link
Contributor Author

mxweaver commented Jan 9, 2022

@markerikson No worries, I'll fix the conflicts and formatting and push to this branch.

@netlify
Copy link

netlify bot commented Jan 9, 2022

✔️ Deploy Preview for redux-docs ready!

🔨 Explore the source changes: 7dafff5

🔍 Inspect the deploy log: https://app.netlify.com/sites/redux-docs/deploys/61db60d5c514f100076b0fa5

😎 Browse the preview: https://deploy-preview-4256--redux-docs.netlify.app

@mxweaver
Copy link
Contributor Author

mxweaver commented Jan 9, 2022

@markerikson Ok, I fixed the merge conflicts with master. I opened another PR for formatting the docs as it seems out of scope: #4257.

@markerikson
Copy link
Contributor

Thanks, merged the formatting PR. (Personally I've always been fine to smuggle cleanup fixes into whatever I'm working on atm, but this works too.)

Seeing a weird failure with this build now while trying to install packages:

npm ERR! @yarn-tool/resolve-package not accessible from rollup-plugin-typescript2

Googling suggests that there's now a package versioning mismatch between package.json and package-lock.json, which is probably due to how the merge conflict got resolved.

@mxweaver
Copy link
Contributor Author

mxweaver commented Jan 9, 2022

@markerikson Ah, sorry about that. I just reset my branch's package-lock.json to master, then ran a clean npm install, then committed the resulting package-lock.json. That should to the trick 🤞

@markerikson markerikson merged commit 120990d into reduxjs:master Jan 9, 2022
@markerikson
Copy link
Contributor

Thanks!

@mxweaver mxweaver deleted the upgrade-rollup-plugin-typescript branch January 10, 2022 01:51
nevilm-lt pushed a commit to nevilm-lt/redux that referenced this pull request Apr 22, 2022
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.

2 participants