question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lab theme augmentation instructions cause syntax error

See original GitHub issue
  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The “About the lab” docs suggest adding this line when creating the MUI theme:

import type '@material-ui/lab/themeAugmentation';

which causes error TS1005: '=' expected.

Expected Behavior 🤔

The import suggested by the docs doesn’t cause a syntax error. I’ve filed https://github.com/microsoft/TypeScript/issues/40051 to suggest this as a TypeScript feature, but in the mean time we may suggest the import be:

import '@material-ui/lab/themeAugmentation'

Your Environment 🌎

Tech Version
Material-UI v4.11.0
TypeScript v3.9.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

20reactions
ianschmitzcommented, Aug 14, 2020

Actually @oliviertassinari i just discovered that import '@material-ui/lab/themeAugmentation' actually emits a runtime import which isn’t ideal. That’s by design for side-effect imports. Maybe we have a better suggestion until TypeScript possibly implements https://github.com/microsoft/TypeScript/issues/40051?

I used in my code base:

// Required to use type import, as a plain side-effect import will be emitted to runtime.
import type {} from "@material-ui/lab/themeAugmentation";
0reactions
oliviertassinaricommented, Aug 13, 2021

the instruction given in the next documentation causes #27704

@fcole90 Yeah, if you use the docs of v5, you also need to have v5 installed 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lab theme augmentation instructions cause syntax error #22203
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >
@mui/lab | Yarn - Package Manager
@mui/lab. This package hosts the incubator components that are not yet ready to move to core . Installation. Install the package in your...
Read more >
Extending Material UI theme via Module Augmentation not ...
I'm trying to extend Theme with Material UI, but it's throwing an error, saying that I'm not extending it correctly, saying,
Read more >
Breaking changes in v5, part one: styles and themes - MUI
This is a reference guide to all of the breaking changes introduced in Material v5, and how to handle them when migrating from...
Read more >
mui/material/CHANGELOG.md - UNPKG
05 --> [lab] Use the public API for module augmentation (#27735) @oliviertassinari ... 22 -->[docs] Fix syntax error in v5 migration `styled` api...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found