-
Notifications
You must be signed in to change notification settings - Fork 436
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
TS2305: Module '"[...]node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.umd"' has no exported member 'grpc'. #369
Comments
First thing I note is that you are consuming the |
@jonny-improbable Yes, I too thought that was a little weird. |
@nothingrandom I'd dig into why it's picking up the |
@jonny-improbable Weirdly that gives me an error with the other file instead / as well
|
Ah, I meant removing the line. Are you able to create a minimal repro for this? |
Yes, I did remove just that one line. The file now looks like this.
I am able to do so, but it's not going to be quick. This is quite a heavy repo currently |
If things still aren't clear, I'm happy to make a test vue cli app using a basic import for this and share it? Might have a chance over the weekend, most likely Monday. If it'd help? |
That would certainly help, although I seem to recall a similar issue over
on the ts-protoc-gen with Vue which I recall being unable to root cause in
the end :(
…On Fri, 8 Mar 2019 at 16:05, Benjamin Hollway ***@***.***> wrote:
If things still aren't clear, I'm happy to make a test vue cli app using a
basic import for this and share it? Might have a chance over the weekend,
most likely Monday. If it'd help?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#369 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMN-ZoEg0iMw_yRIYbLtuwDU86gqokGks5vUopRgaJpZM4bliHW>
.
|
Gonna ensure that's not the case here; I'll have to find a cause eventually. Internal product that's far too deep to switch to React / other and requires access to I'll get that sorted quickly. Ought I try base it off of |
That sounds like a great idea, I'd be happy to help you land it back into
the repo :)
…On Fri, 8 Mar 2019 at 16:24, Benjamin Hollway ***@***.***> wrote:
Gonna ensure that's not the case here; I'll have to find a cause
eventually. Internal product that's far too deep to switch to React / other
and requires access to stream.
I'll get that sorted quickly. Ought I try base it off of
grpc-web-react-example so that it can be useful for others in the future
looking at this from a Vue / webpack POV?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#369 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANga8UmgD4mPFXGYfagIUCBtLDkYUQaOks5vUo7BgaJpZM4bliHW>
.
|
Hey, couple of questions whilst I'm looking at my root repo. It appears it's aiming for the Is the import I make, aiming to hit the |
@jonny-improbable @jonnyreeves. Got the test project "working" (gives the same error, but I guess that's a good thing?) https://github.com/nothingrandom/grpc-vue-test-project Let me know if you have any questions, some things are a little different to the react example you have; but they can all get sorted / aligned later |
Morning @nothingrandom; thanks for the repro! I will try to take a look this week, work schedule permitting, although as always I'd welcome input from anyone else who has the time to dig in. |
I encountered the same problem today when I tried to upgrade the grpc-web dependency. import { grpc } from '@improbable-eng/grpc-web'; It also decided to use the umd file and couldn't find the export. !function (e, t) {
if ('object' == typeof exports && 'object' == typeof module) {
module.exports = t();
} else if ('function' == typeof define && define.amd) {
define([], t);
} else {
var n = t();
for (var r in n) ('object' == typeof exports ? exports : e)[r] = n[r];
}
}(window, function () { ... }); Apparently,
Hope this helps somehow. |
@ypoluektovich; Looks like it could be a useful hotfix. What file are you adding that to? |
@nothingrandom Just the |
@ypoluektovich; you're somewhat correct. Useful but not a viable implementation for us. It also seems a bit "hotfix" and it'd be nice to have the package work as expected. Thanks for checking this out for me though |
Hey @jonny-improbable. Did you manage to get around to having a look at this? |
I did not yet, sorry :(
…On Mon, 15 Apr 2019 at 10:06, Benjamin Hollway ***@***.***> wrote:
Hey @jonny-improbable <https://github.com/jonny-improbable>. Did you
manage to get around to having a look at this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#369 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADMBV4N2SXRVDTGV7AMLINLPQRASBANCNFSM4G4WEHLA>
.
|
I have a similar issue with rollup. I had to define a namedExport to make this work with Something like commonjs({
namedExports: {'path/to/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.umd.js': ['grpc']}
}), |
Having the same error as well via rollup, I had to slightly tweak @graup's fix ( commonjs({
namedExports: {
'./node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js': [
'grpc',
],
},
}), |
I'm getting this error as well while trying to compile with rollup. Specifically with the bazel rule
|
I ran into this working on Dig-Doug/rules_typescript_proto#13 as well. It looks like the examples use a ES module syntax
I believe historically tools like Webpack/Rollup gracefully handled this, however lately it seems more and more are refusing the transparently convert between CommonJS/ESM formats. Configuring Webpack to generate a ESM lib and adding References: |
This is fixed, somehow in |
Cool! |
This is probably a mistake my side, and it's 4pm Friday so we'll see if I can fix it after the beers make an appearance - but I thought I'd make a cry for help also!
package.json
service / request user.ts
fileimport {grpc} from "@improbable-eng/grpc-web";
Full browser log
Module import folder
The text was updated successfully, but these errors were encountered: