Skip to content

Conversation

@spacenate
Copy link
Contributor

As a developer building a GAS project using ES modules (import/export), I would like to be able to import this package:

import { OAuth2 } from 'OAuth2';

Currently, this fails with an error like so:

Module not found: Error: Can't resolve 'OAuth2' in '/Users/nathan/.../src'

Field 'browser' doesn't contain a valid alias configuration

After declaring an entry-point for this package (via package.json), then I am able to import the package without error.

@google-cla
Copy link

google-cla bot commented Aug 11, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Fixes `Module not found: Error: Can't resolve 'OAuth2' in '/Users/.../src' [...] Field 'browser' doesn't contain a valid alias configuration` when trying to import this package as an ES module.
@sqrrrl sqrrrl merged commit cf14956 into googleworkspace:main Sep 22, 2022
@spacenate spacenate deleted the adds-entrypoint branch September 22, 2022 19:53
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.

3 participants