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

Correctly separate out webpack-helpers.d.ts #214

Merged
merged 1 commit into from Dec 30, 2018
Merged

Correctly separate out webpack-helpers.d.ts #214

merged 1 commit into from Dec 30, 2018

Conversation

PeterFaiman
Copy link
Contributor

@PeterFaiman PeterFaiman commented Dec 20, 2018

The webpack install code from https://stimulusjs.org/handbook/installing is for javascript. It should work for typescript too if the extension is changed from js to ts, but it generates the following error:

ERROR in /Users/peterfaiman/code/stimulus-example/src/index.ts
[tsl] ERROR in /Users/peterfaiman/code/stimulus-example/src/index.ts(2,40)
      TS7016: Could not find a declaration file for module 'stimulus/webpack-helpers'. '/Users/peterfaiman/code/stimulus-example/node_modules/stimulus/webpack-helpers.js' implicitly has an 'any' type.

Typescript finds the declaration once moved to webpack-helpers.d.ts.

The webpack install code from https://stimulusjs.org/handbook/installing
is for javascript. It should work for typescript too if the extension is
changed from js to ts, but it generates the following error:

ERROR in /Users/peterfaiman/code/stimulus-example/src/index.ts
[tsl] ERROR in /Users/peterfaiman/code/stimulus-example/src/index.ts(2,40)
      TS7016: Could not find a declaration file for module 'stimulus/webpack-helpers'. '/Users/peterfaiman/code/stimulus-example/node_modules/stimulus/webpack-helpers.js' implicitly has an 'any' type.

Typescript finds the declaration once moved to webpack-helpers.d.ts.
@javan javan merged commit 61457c2 into hotwired:master Dec 30, 2018
@javan
Copy link
Contributor

javan commented Dec 30, 2018

Thanks! You can work around this for now by installing and importing the @stimulus/webpack-helpers package directly:

import { definitionsFromContext } from "@stimulus/webpack-helpers"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants