-
Notifications
You must be signed in to change notification settings - Fork 55
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
Package do not mesh well with TSC and allowJs #437
Comments
We have a tripple-slash reference to "../dom-shim.d.ts" in msRest.ts and we pack this file at root folder of the package. The build output dir is |
@witemple-msft does the file |
Ok, it does look like Typescript compilation won't copy the reference to the output folder, so probably why we keep it outside of the source tree. |
@kant2002 I tried the repro steps, however I need to do a couple of things before I see the error about dom-shim.d.ts.
then I see 28 errors, the last one about dom-shim.d.ts. Are you seeing similar errors? I want to make sure I am not missing something as the errors seem indicating nothing would work for me.
ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 7:20-44
Module not found: Error: Can't resolve './webResource' in 'C:\working\rest-js-437\node_modules\@Azure\ms-rest-js\es\lib'
@ ./index.ts 3:15-43
ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 9:26-56 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 11:20-44 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 13:29-62 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 15:18-40 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 17:22-48 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 20:30-64 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 22:18-45 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 24:18-49 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 26:22-57 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 29:38-89 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 31:31-75 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 33:31-75 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 35:30-73 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 37:20-53 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 39:20-53 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 42:23-59 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 44:22-57 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 46:24-61 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 49:30-73 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 52:19-42 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 56:14-37 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 69:12-28 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 73:25-66 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 75:39-94 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 77:26-68 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 79:25-66 ERROR in ./node_modules/@azure/ms-rest-js/es/lib/msRest.js 81:26-68 ERROR in C:\working\rest-js-437\node_modules@azure\ms-rest-js\es\lib\msRest.js |
@jeremymeng sorry for delay. You can checkout minimal repro https://github.com/kant2002/msrestjs-437 |
I have global typescript installed, but likely it can be installed in the project too. |
@kant2002 Thanks for the repro project! I had global typescript (v4.1.2) installed too but still getting the same error even with your project. Could you please help perform the following test?
and see if that helps? I was playing with the repro project, and found that I could get the webpack to bundle the project by
resolve: {
extensions: ['.ts', '.js']
},
|
@jeremymeng So essentially copying |
@kant2002 It's just an experiment. If it fixed the issue, we could potentially add it in the npm package. |
@jeremymeng copy helps. |
@jeremymeng will this be fixed, or this would be unsupported feature? |
@kant2002 Thanks for the confirmation! We definitely want to fix the issue but also need to prioritize it among work items. Will keep you updated. |
This is an interesting scenario. @bterlson @xirzec @chradek @witemple-msft any thoughts? Summary
One potential fix is copying that file to |
So the problem was introduced by this change? 773a3f0 I guess it's tricky to fix this without re-introducing the problems of #367 I'm a little confused why we seem to have both https://github.com/Azure/ms-rest-js/blob/master/lib/dom.d.ts Can't we just remove |
We should probably do the same thing here (and in core-http v1 for track-2) as we did in Azure/azure-sdk-for-js/pull/14092. |
Package Version: 2.2.3
To Reproduce
Steps to reproduce the behavior:
index.js
webpack.config.js*
tsconfig.json
Make sure that
allowJs
set totrue
package.json
** Error output **
Expected behavior
Compilation without errors
The text was updated successfully, but these errors were encountered: