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

Support custom Webpack SSR solutions #114

Closed
jacek213 opened this issue Apr 27, 2020 · 10 comments
Closed

Support custom Webpack SSR solutions #114

jacek213 opened this issue Apr 27, 2020 · 10 comments

Comments

@jacek213
Copy link

Hello,

I'm trying to integrate this lib into node app which uses webpack.

However it all ends up with an error:

ERROR in ./node_modules/@appsignal/nodejs-ext/build/Release/extension.node 1:0
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
 @ ./node_modules/@appsignal/nodejs-ext/dist/index.js 2:17-59
 @ ./node_modules/@appsignal/nodejs/dist/extension.js
 @ ./node_modules/@appsignal/nodejs/dist/agent.js
 @ ./node_modules/@appsignal/nodejs/dist/client.js
 @ ./node_modules/@appsignal/nodejs/dist/index.js
 @ ./src/server/app.tsx
 @ ./src/server/index.ts

Help would be much appreciated :)

@adamyeats
Copy link
Contributor

adamyeats commented Apr 27, 2020

@jacek213 This is expected, as extension.node is a native extension, and Webpack doesn't know how to handle those. What is it you're trying to achieve? We already have a webpack integration here: https://github.com/appsignal/appsignal-javascript/tree/develop/packages/webpack

@jacek213
Copy link
Author

I want to integrate appsignal into react app which has SSR enabled, thus a part of the app is a node server. Server + frontend app is bundled with webpack. Should I stick to javascript integration only?

@adamyeats
Copy link
Contributor

@jacek213 Understood! Admittedly, as this project is still in the early stages, our story around SSR enabled apps is not great (yet). We want to have a much better story around this, including performance monitoring, but this will take a little time.

I'd recommend seeing how far you can get with the JavaScript integration for now - we have a new release going out this week that should make things much better for SSR enabled apps, but the current version should still work. If it doesn't work for you, feel free to follow up with me in a new issue in the appsignal-javascript repo.

For now, it would help me to know, are you using a framework like Next.js or Gatsby to manage this, or did you roll your own solution with Webpack?

@jacek213
Copy link
Author

@xadamy thanks a lot for clarification :) We're about to test the @appsignal/javascript and @appsignal/react in the first place then.

We're not using any frameworks - we have our own solution built with webpack.

@adamyeats
Copy link
Contributor

@jacek213 Great, in which case I'll turn this into a tracking issue for supporting custom Webpack SSR solutions. I'll update this issue once there's any progress here. Thanks!

@adamyeats adamyeats changed the title webpack throws error on extension.node file Support custom Webpack SSR solutions Apr 27, 2020
@adamyeats adamyeats self-assigned this Apr 27, 2020
@jacek213
Copy link
Author

@xadamy I just noticed that nodejs lib v1.0 had been released, any progress on the webpack part? :)

@HamptonMakes
Copy link

I'm hitting this issue trying to get this working in an electron app!

@adamyeats
Copy link
Contributor

@jacek213 No updates just yet, but expect something very soon along! 🤞

@hcatlin @jacek213: It would help me greatly if I was able to reproduce the way you're setting things up locally, particularly how you are setting up your webpack.config.js. Are you able to share a reproducible test case with a git repo or a code hosting tool like CodeSandbox?

@adamyeats
Copy link
Contributor

Also, I'm wondering if adding node-loader to webpack.config.js solves this issue for anyone?

@adamyeats adamyeats removed their assignment Apr 19, 2021
@luismiramirez
Copy link
Member

Not relevant anymore with v3

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

No branches or pull requests

4 participants