Coder Social home page Coder Social logo

trustworktech / create-react-ssr-app Goto Github PK

View Code? Open in Web Editor NEW
91.0 9.0 30.0 1.99 MB

Set up a modern react app with server side rendering by running one command.

Home Page: https://create-react-ssr-app.dev

License: MIT License

JavaScript 80.49% Shell 2.29% CSS 3.89% HTML 4.90% AppleScript 3.55% TypeScript 4.89%
react zero-configuration build-tools

create-react-ssr-app's People

Contributors

opeah avatar sanklein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-react-ssr-app's Issues

No 'Access-Control-Allow-Origin' header is present on the requested resource

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

CORS

Environment

System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz
Binaries:
Node: 8.10.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: 75.0.3770.100
Firefox: 65.0.1
Safari: 12.1.1
npmPackages:
escape-string-regexp: ^2.0.0 => 2.0.0 (1.0.5, 1.0.5)
express: ^4.17.1 => 4.17.1
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-ssr-scripts: 2.1.3 => 2.1.3
npmGlobalPackages:
create-react-ssr-app: Not Found

Steps to Reproduce

  1. Create a new app using npx create-react-ssr-app
  2. Try to link to any local font file from a CSS file (and also make sure to use that font)
  3. Get the CORS error

Expected Behavior

Font loads without CORS error

Actual Behavior

Font doesn't load. Instead I get a CORS error:
cors

Template doesn't run

I created a new application using npx create-react-ssr-app my-app. When attempting to run the application I recievce the error 'Error parsing app.html'.

Build Error: Cannot find module ‘./utils/verifyTypeScriptSetup’

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Environment

System:
OS: Linux 3.10 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (40) x64 Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
escape-string-regexp: ^2.0.0 => 2.0.0 (1.0.5, 1.0.5)
express: ^4.17.1 => 4.17.1
react: ^16.8.6 => 16.8.6
react-dom: ^16.8.6 => 16.8.6
react-ssr-scripts: 2.1.3 => 2.1.3
npmGlobalPackages:
create-react-ssr-app: Not Found

Steps to Reproduce

  1. Use a Linux distribution
  2. Try to build a previously created project using npm run build

Expected Behavior

Build finishes without errors

Actual Behavior

Build failed with error:
build-error

Styles don't load in development (JS Disabled)

Thanks for this awesome script, works perfect without any configs (after spending few hours with Razzle and scss). 👍

Looks like the styles are not loaded in development if Javascript is disabled. Though it works fine in production version. Wanted to test pages with SSR in development with Js turned off. Is there any way to make the css load as well? Not a deal breaker though.

Customizing webpack config?

Is it possible to customize webpack config? I'm using code splitting using react-loadable and it require a ReactLoadablePlugin added to webpack.

Implementing redux is not working, I get error unexpected token %

Is this a bug report?

(write your answer here)

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here)

Steps to Reproduce

(Write your steps here:)

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Please add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Post Request

Uncaught (in promise) SyntaxError: Unexpected end of input

when i have updated build on production on server. i am getting __HELMET_META_ATTRIBUTES__ __STYLE_TAGS__ printed in html.

Describe the bug

(Write your answer here.)

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here.)

Steps to reproduce

(Write your steps here:)

Expected behavior

(Write what you thought would happen.)

Actual behavior

(Write what happened. Please add screenshots!)

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

How to fetch data on server side?

Thanks, @maxparelius for such a nice project. It looks really promising. Currently, I am facing an issue regarding fetching data on the server-side (as there is no example).

In Next.js/After.js we have a method named getInitialProps to fetch data on the server-side. Does CRSA have anything like that?

Proxy in package.json

Adding proxy in package.json is not working but if I add it directly in axios.get() it is working.
This is what I get when it is from the proxy in package.json
image

And when I npm start I'm getting this DeprecationWarning
image

Already tried proxy in package.json in create-react-app and it is working.
image

Error to install

Hi, i'm try install, and receive this error.

`[eval]:3
init.apply(null, JSON.parse(process.argv[1]));
^

TypeError: init.apply is not a function
at [eval]:3:14
at Script.runInThisContext (vm.js:123:20)
at Object.runInThisContext (vm.js:312:38)
at Object. ([eval]-wrapper:6:22)
at Module._compile (internal/modules/cjs/loader.js:734:30)
at evalScript (internal/process/execution.js:56:25)
at executeUserCode (internal/bootstrap/node.js:499:5)
at startMainThreadExecution (internal/bootstrap/node.js:439:3)

Aborting installation.
node has failed.`

Hosting on heroku

Running the production build script sets ASSETS_PATH path to http://0.0.0.0:3030
Results in production:

<script src="http://0.0.0.0:3030/static/js/bundle.js"></script>
<script src="http://0.0.0.0:3030/static/js/0.chunk.js"></script>
<script src="http://0.0.0.0:3030/static/js/main.chunk.js"></script>

Local build uses relative path.

Any idea that might help?

ESLint Definition for rule '@typescript-eslint/consistent-type-assertions'

Describe the bug

This bug related to eslint.

Did you try recovering your dependencies?

yes
npm: 6.11.3

Environment

Environment Info:

System:
OS: Linux 4.15 Linux Mint 19.1 (Tessa)
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 12.10.0 - ~/.nvm/versions/node/v12.10.0/bin/node
Yarn: Not Found
npm: 6.11.3 - ~/.nvm/versions/node/v12.10.0/bin/npm
Browsers:
Chrome: 77.0.3865.90
Firefox: 69.0.1
npmPackages:
react: ^16.10.0 => 16.10.0
react-dom: ^16.10.0 => 16.10.0
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

1. npx create-react-ssr-app my-app --typescript
2. eslint src/**/*.ts src/**/*.tsx

Expected behavior

Eslint should work.

Actual behavior

i get this error:

 1:1  error  Definition for rule '@typescript-eslint/consistent-type-assertions' was not found  @typescript-eslint/consistent-type-assertions

Reproducible demo

Not needed.

Related issues on react-scripts

typescript-eslint/typescript-eslint#863
facebook/create-react-app#7709
facebook/react#16845

Seems like updating react-scripts to ^3.1.2 fixes issue, but i cannot find u are using this package at all :) mby its dependency version related.

Deployment to server

How could i deploy it to surge or node server?Trying to deploy it in firebase but it didn't work out

How to write your own api breakpoints?

Hi!

I really enjoy your repo but I cannot find any information about creating your own API breakpoints.
Can you tell me how to write this:

app.get('/contact', (req,res) => {
res.send({id:1, name: 'test'});
}

and fetch this data from any components??

componentDidMount() {
fetch('/contact').then(resp => resp.json()).then(data => console.log(data));
}

I'm getting error and this breakpoint it's not working.

Please answer me beacuse of that I cannot use your app well ;/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.