Comments (6)
Do you know where this is happening?
export default typeof process !== 'undefined' ? process : {
env: /** @type {Config} */({ NODE_ENV: 'development' }),
argv: /** @type {string[]} */ ([]),
};
We already should be guarding against undefined it seems.
Edit: NVM I see #269
from diffhtml.
I created a reduced test case and can't reproduce this behavior:
tim in ~/tmp/tmp.Fymt36hUrW on from-work-laptop
λ cat package.json
{
"dependencies": {
"diffhtml": "^1.0.0-beta.27",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
}
}
tim in ~/tmp/tmp.Fymt36hUrW on from-work-laptop
λ cat index.js
import { innerHTML } from 'diffhtml';
console.log(innerHTML);
tim in ~/tmp/tmp.Fymt36hUrW on from-work-laptop
λ webpack ./index.js
asset main.js 24.2 KiB [compared for emit] [minimized] (name: main)
orphan modules 111 KiB [orphan] 34 modules
runtime modules 670 bytes 3 modules
./index.js + 34 modules 111 KiB [built] [code generated]
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
webpack 5.72.0 compiled with 1 warning in 921 ms
tim in ~/tmp/tmp.Fymt36hUrW on from-work-laptop
λ node ./dist/main.js
[Function: Fe]
from diffhtml.
Wait, how will running an example code in Node (which provides process
globally) illustrate that process
is (not) required? 😓
from diffhtml.
Here's a repo with the repro steps you tried, plus an HTML page for trying out the bundle Webpack produces:
https://github.com/justjake/diffhtml-repro
Instructions to repro:
npm install
npm run build
npx serve
- Open the
npx serve
URL in your browser.
from diffhtml.
Looks like webpack does weird things when it sees process
in modules, even when the reference is pulled from a module export and not the global scope. I renamed all the internal references to nodeProcess
instead of process
and the error goes away:
from diffhtml.
Kind of annoying fix, but it is important to support webpack defaults.
https://github.com/tbranyen/diffhtml/pull/270/files
from diffhtml.
Related Issues (20)
- boolean attributes get non-empty string values repeating the attribute name: attr="attr" HOT 4
- Issues with createState HOT 1
- More tests for babel transform plugin
- DevTools
- React compat layer HOT 1
- executeScripts does not work in Firefox HOT 8
- Function component: how to use props as slot like custom component? HOT 27
- Components do not mount if missing a return value HOT 1
- delete in removeAttribute causes TypeError HOT 7
- diffhtml/lite: `innerHTML(someNode, "only text")` fails HOT 3
- Tracking new HTML parser work HOT 3
- Cannot interpolate string attributes directly HOT 1
- createSideEffect runs on re-render even if already mounted HOT 3
- Parser bug where multiple elements on a single line fails
- Attributes without values breaks the parser HOT 3
- Can't run other packages with core using Deno HOT 2
- setHTML
- diffhtml.org is down HOT 6
- innerHTML fails to diff element when its children have been diffed previously HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffhtml.