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

Server Side Rendering syntax issue #38

Closed
DavidWells opened this issue Jan 4, 2015 · 1 comment · May be fixed by OrderMyGear/react-select#2
Closed

Server Side Rendering syntax issue #38

DavidWells opened this issue Jan 4, 2015 · 1 comment · May be fixed by OrderMyGear/react-select#2

Comments

@DavidWells
Copy link

I think this is related to issue #35

I'm rendering components server-side in Node and when firing up the server trying to use the npm module I get the following error:

/node_modules/react-select/src/Select.js:439
            return <div key={'option-' + op.value}
                   ^
SyntaxError: Unexpected token <
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/src/app/components/thiscomponent.jsx:3:11)
    at Module._compile (module.js:456:26)
    at Object.require.extensions.(anonymous function) [as .jsx] (/node_modules/node-jsx/index.js:26:12)
    at Module.load (module.js:356:32)

It would appear that the .js extension is not compiling correctly.

The only fix I could come up with was hardcoding the react-select module (and dependencies. auto-text-resize had same syntax issue) into my apps components and renaming the extensions .jsx. Now everything works.

Is there something we can do, or I can help with to get this working node side?

Thanks for the rad component!

@JedWatson
Copy link
Owner

I fixed this by building a new /lib folder that already has the jsx parsed, so it should work correctly now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants