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

Optional chaining issue with Node v10/v12 builds in release 6.2.0 #2902

Closed
kalbukov4265 opened this issue Aug 6, 2021 · 3 comments · Fixed by #2905
Closed

Optional chaining issue with Node v10/v12 builds in release 6.2.0 #2902

kalbukov4265 opened this issue Aug 6, 2021 · 3 comments · Fixed by #2905
Labels
Bug An issue with our existing, production codebase. Infrastructure Related to the helper and utility scripts in the project. workbox-expiration

Comments

@kalbukov4265
Copy link

kalbukov4265 commented Aug 6, 2021

Library Affected:workbox-expiration

Browser & Platform:all browsers

Issue or Feature Request Description
When I start running build workbox got an error :

ERROR in ./node_modules/workbox-recipes/node_modules/workbox-expiration/models/CacheTimestampsModel.js 96:21
Module parse failed: Unexpected token (96:21)
You may need an appropriate loader to handle this file type.
|         const db = await this.getDb();
|         const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));
>         return entry?.timestamp;
|     }
|     /**

Can you fix optional chaining in "entry?.timestamp;" ?

@jeffposnick
Copy link
Contributor

Thanks for pointing this out. Our intention wasn't to change the minimum required version of Node with the v6.2.0 release, so we'll likely get v6.2.1 out in the near future. (You should be fine sticking with v6.1.5 until then.)

Can you help us by sharing some more information about your build process? We use Babel to transpile our source code down to Node v10.x compatibility, but that only applies to our bundled releases. We might have a blind spot when it comes to transpiling code that is read unbundled via cross-dependencies in our monorepo, and if you shared your build process that would help us understand how to avoid this in the future.

@jeffposnick jeffposnick added Bug An issue with our existing, production codebase. Infrastructure Related to the helper and utility scripts in the project. workbox-expiration labels Aug 6, 2021
@jeffposnick jeffposnick changed the title build error with workbox-expiration 6.2.0 Optional chaining issue with Node v10/v12 builds in release 6.2.0 Aug 6, 2021
@jeffposnick
Copy link
Contributor

After a closer look at where this untranspiled code might have appeared, I believe that changing our project-level tsc configuration to use a more conservative target should resolve the issue.

@jeffposnick
Copy link
Contributor

This should now be fixed in https://github.com/GoogleChrome/workbox/releases/tag/v6.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An issue with our existing, production codebase. Infrastructure Related to the helper and utility scripts in the project. workbox-expiration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants