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

slider.d.ts has wrong import syntax #671

Closed
jon-smith opened this issue Dec 6, 2018 · 0 comments
Closed

slider.d.ts has wrong import syntax #671

jon-smith opened this issue Dec 6, 2018 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@jon-smith
Copy link

I'm submitting a ...

[x] bug report

Current behavior
When importing a primereact Slider into a typescript file import { Slider } from 'primereact/slider'; compilation fails with error
(1,1) Statements are not allowed in ambient contexts.

Expected behavior
Compilation should not fail.

Potential fix (Happy to put this in as a pull request if that helps.)
If I replace the contents of primereact/slider.d.ts with
export * from 'primereact/components/slider/Slider';
then it compiles file. This is consistent with all other d.ts files I've seen.

Minimal reproduction of the problem with instructions
In a .tsx file:
import { Slider } from 'primereact/slider';
tsconfig.json:
{ "compilerOptions": { "baseUrl": ".", "outDir": "build/dist", "module": "esnext", "target": "es5", "lib": [ "es6", "dom", "es2018" ], "sourceMap": true, "allowJs": true, "jsx": "react", "moduleResolution": "node", "rootDir": "src", "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": false, "allowSyntheticDefaultImports": true }, "exclude": [ "node_modules", "build", "scripts", "acceptance-tests", "webpack", "jest", "src/setupTests.ts" ], "include": [ "./src/**/*" ] }

Please tell us about your environment:
Windows 10, Visual Studio Code, npm

  • React version:
    16.6.3

  • PrimeReact version:
    2.0.1

  • Language:
    TypeScript 3.2.1

@cagataycivici cagataycivici self-assigned this Dec 23, 2018
@cagataycivici cagataycivici added the Type: Bug Issue contains a defect related to a specific component. label Dec 23, 2018
@cagataycivici cagataycivici added this to the 3.0.0-rc1 milestone Dec 23, 2018
@cagataycivici cagataycivici changed the title slider.d.ts compile error "Statements are not allowed in ambient contexts." slider.d.ts has wrong import syntax Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants