I made a pixel art piece on Adobe Illustrator, painting singular squares of a generated grid. I turned off the stroke so no grids are visible, but when I export, there are very faint hairlines. How do I fix this?
Illustrator could be used for pixel art. If you feel it gives you some benefits then why not? I assume you want to export raster images to PNG format.
The example you show doesn't really look like pixel art to me though. You have several places where the rectangles of the two used colors doesn't seem to follow the same grid. Or at least the grid has a pretty high resolution.
You should work at the actual size where one pixel in your drawing is a 1×1 px square and follow the pixel grid.
You can of course make something more similar to your example with larger rectangles, but you still need them to snap to the pixel grid.
If you export a PNG at the actual size (72 ppi), the unwanted lines between pixels wouldn't be possible (since in raster graphics no line can be thinner than 1 px).
To save as a PNG use File > Export > Export As. Set Save as type to PNG You probably want to check Use Artboards to get a file exactly the size of your artboard.
Then set Resolution to Screen (72 ppi), Anti-aliasing to None and choose the Background Color you want.
If you want to scale up the drawing on export, set the resolution to a multiplication of 72 ppi (72, 144, 216, 288 etc.) so each pixel of your original image will be rendered with a whole number of pixels.
Lock your grid in the layers panel so that it cannot be selected. Hopefully you have them in one layer which doesn't contain other objects.
If it happens that there's still unexpanded rectangles (=the color is still an effect) select all, expand the appearance and ungroup all as many times as needed to get all groups disassembled. See the progress in the Layers panel.
Select one brown item, then select the rest of them by applying Select > Same > Fill Color. Insert 1 px wide brown stroke.
Do the same to Orange and grey items with their colors. The big idea is to generate overlaps which prevent the background being visible through the narrow transparent gaps which are left by the inaccuracy of your colorizing method and the general rendering to the raster screen.
Not asked: I have thought a bitmap drawing program is the tool for pixel artists. It's no problem to scale say 100px x 100px bitmap image bigger, say to 2000px x 2000px and still keep it sharp. If you can show some real but not so easy to understand benefits that your vector approach offers many of us surely are interested in hearing them.