Skip to content

Instantly share code, notes, and snippets.

@jaketrent
Last active May 17, 2021 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaketrent/0b40e4084c3381d3eb57025ef095bfe9 to your computer and use it in GitHub Desktop.
Save jaketrent/0b40e4084c3381d3eb57025ef095bfe9 to your computer and use it in GitHub Desktop.
Reproducing glamor warning in build error

Confirmed! I am able to reproduce the warning when running npm run build:

export 'default' (imported as 'glamorDefault') was not found in 'glamor' (possible exports ...)

This is unfortunate because it is chatty in your build logs. It should not cause a problem at runtime, however.

The short-term guidance for this warning is to try to ignore it for the next couple months. This is because glamor is being removed from the Design System over the next couple months.

import Tooltip from '@pluralsight/ps-design-system-tooltip'
import React from 'react'
const App: React.FC = (props) => {
return (
<div>
app
<Tooltip>Tooltip here</Tooltip>
</div>
)
}
export default App
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>Test</title>
<link rel="stylesheet" href="normalize.css">
</head>
<body>
<h1>Testing Tooltip and Glamor in Webpack</h1>
<div id="root"></div>
<script src="bundle.js"></script>
</body>
</html>
import React from 'react'
import ReactDOM from 'react-dom'
import App from './app'
ReactDOM.render(<App />, document.getElementById('root'))
{
"name": "test-glamordefault",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack",
"start": "http-server public"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/react": "^17.0.5",
"@types/react-dom": "^17.0.5",
"http-server": "^0.12.3",
"ts-loader": "^9.1.2",
"typescript": "^4.2.4",
"webpack": "^5.37.0",
"webpack-cli": "^4.7.0"
},
"dependencies": {
"@pluralsight/ps-design-system-normalize": "^4.4.1",
"@pluralsight/ps-design-system-tooltip": "^8.1.1",
"glamor": "^2.20.40",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
{
"compilerOptions": {
"outDir": "./dist/",
"noImplicitAny": true,
"module": "es6",
"target": "es5",
"jsx": "react",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
}
}
const path = require('path')
module.exports = {
mode: 'production',
entry: './src/index.tsx',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment