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

@fluentui/react now fails #48

Closed
FallingSnow opened this issue Apr 6, 2021 · 11 comments
Closed

@fluentui/react now fails #48

FallingSnow opened this issue Apr 6, 2021 · 11 comments

Comments

@FallingSnow
Copy link

https://esm.sh/@fluentui/react@8.9.0

/* esm.sh - error */
throw new Error("[esm.sh] " + "esbuild: Ambiguous import \"DateRangeType\" has multiple matching exports");
export default null;

Used to work but now displays this error.

@ije
Copy link
Member

ije commented Apr 7, 2021

i will fix it ASAP, thanks @FallingSnow

@ije
Copy link
Member

ije commented Apr 7, 2021

fixed, please try again, thanks

@FallingSnow
Copy link
Author

Great, thank you! @fluentui/react now loads.

It seems https://cdn.esm.sh/v38/@fluentui/utilities@8.0.3 is not produced correctly though.

style-utilities.development.js:709 Uncaught (in promise) SyntaxError: The requested module '../../utilities@8.0.3/deno/utilities.development.js' does not provide an export named 'IsFocusVisibleClassName'
async function (async)
bootstrap @ bootstrap.ts:18
(anonymous) @ main.js:3

It is exported:
https://github.com/microsoft/fluentui/blob/dab45a2afe609709735b9b6e604a1af40d50e809/packages/utilities/src/index.ts#L74

@FallingSnow
Copy link
Author

The following does work.

$ npm install @fluentui/utilities
$ node
Welcome to Node.js v15.5.0.
Type ".help" for more information.
> require('@fluentui/utilities').IsFocusVisibleClassName
'ms-Fabric--isFocusVisible'

@FallingSnow
Copy link
Author

Hmmm, seems to be a new error today:
https://cdn.esm.sh/@fluentui/utilities@8.0.3

/* esm.sh - error */
throw new Error("[esm.sh] " + "bucket not found");
export default null;

@ije
Copy link
Member

ije commented Apr 9, 2021

fixed, it is a bug by upgrading the postdb mod, sorry for that!

@FallingSnow
Copy link
Author

No worries. The IsFocusVisibleClassName error still persists though.

@FallingSnow
Copy link
Author

Ok so if we look at .aleph/development/-/cdn.esm.sh/v40/@fluentui/utilities@8.0.4/deno/utilities.development.js we see

__export(lib_exports, {
...
   IsFocusVisibleClassName: ()=>IsFocusVisibleClassName
...
}

However if we look at the var { ... } = lib_exports; line at the end of the file, IsFocusVisibleClassName is no where to be found.

@FallingSnow
Copy link
Author

FallingSnow commented Apr 14, 2021

Also it does seem that esbuild does export this correctly.

Install dependencies:

$ yarn add esbuild react react-dom @fluentui/react

Create app.ts:

import * as out from "@fluentui/react";
console.log(out);

Compile and run (node/browser preset):

$ ./node_modules/.bin/esbuild app.ts --bundle --platform=node --outfile=out.js
$  node out.js
ms-Fabric--isFocusVisible

$ ./node_modules/.bin/esbuild app.ts --bundle --platform=browser --outfile=out.js
$  node out.js
ms-Fabric--isFocusVisible
$ ./node_modules/.bin/esbuild app.ts --bundle --platform=browser --outfile=out.js --format=esm --minify-whitespace --minify-identifiers --minify-syntax --target=es2020
$ node out.js
ms-Fabric--isFocusVisible

also works so it must be something having to do with
https://github.com/postui/esm.sh/blob/6a61989b5d845b028603006f0c56c70e1f2670ef/server/build.go#L180-L182

@ije
Copy link
Member

ije commented Apr 15, 2021

@FallingSnow thanks for the details, i will look into it!

@ije
Copy link
Member

ije commented Aug 7, 2021

fixed in v44 branch

@ije ije closed this as completed Aug 7, 2021
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

No branches or pull requests

2 participants