FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]
https://www.snowpack.dev
Other
727 stars 96 forks source link

@snowpack/app-template-react-typescript build broken #117

Closed aaronshaf closed 4 years ago

aaronshaf commented 4 years ago

Steps to reproduce:

npx create-snowpack-app my_app --template @snowpack/app-template-react-typescript
cd my_app
npm run build
serve -s build

Browser console:

Uncaught TypeError: React.createElement is not a function
    at index.js:8
wiesson commented 4 years ago

I also experienced that bug. It looks like import * as React from '...' is not processed correctly to import React from '...'

ryands17 commented 4 years ago

import * as React build perfectly on @snowpack/app-scripts-react version 1.1.0. I think the new version specifically might be causing this issue.

FredKSchott commented 4 years ago

Sorry about that, it should be import React from 'react' in the official template, but we also should support this in Snowpack. Fixed in https://github.com/pikapkg/snowpack/commit/72933b3dc1e6cead15a950ce2353ae563acec775